What primarily dictates the cobra's reaction to a snake charmer playing a pungi?

Answer

The movement of the flute or the charmer's body

The cobra reacts visually, following the swaying object with its head; it is tracking the visual stimulus, not registering the airborne melody.

What primarily dictates the cobra's reaction to a snake charmer playing a pungi?
Indiareptilehearingsnakecobra