Snakes are deaf right? So how does this work?

So snakes are deaf but they can feel vibrations, right? This was posted in r/Impressively but I am still kind of mesmerized by how snake charming works.

I read in one of the comments that it has to do with the swaying of the flute, that the snakes perceives it as threat.

But I really need to know, this shit is joked about alot, snake charming and all.. But is it REALLY real?? How does this even work?