You need to hold the flute above the basket, but honestly, luring the snake is pointless. It doesn't earn you a trophy or anything like that.