Snakes don’t understand music at all, and they have almost no hearing. Snakes have no outer and middle ears, only ear column bones, and no tympanic membrane, tympanum and Eustachian tube, so snakes cannot receive sound waves conducted by air. The way snakes sense external messages is to receive the vibrations of external sounds through the surface of their mandibles, and then transmit them to the brain through the rod-shaped stapes in the inner ear. When snakes walk, their mandibles are mostly close to the ground, so they can detect them very sensitively. The vibrations on the ground enable snakes to remain alert to external conditions. Therefore, the sounds "heard" by snakes come from vibrations transmitted by the ground, and the sound of music is just deaf to snakes.
The Indians play the flute (Pengji) to make snakes dance, but the performance is just a show to deceive others. The snake charmer's feet tapped on the ground and the wooden stick hit the snake basket. The snake felt movement, and then it poked its head out of the snake basket, looking for a target to attack. It had nothing to do with playing music.