Play sound when hover #Rawabi

I want to play sound when hover on text. I upload a music and make it hidden, and give it “posiEn” as ID, then I write this function:

export function clipArt1_mouseIn(event, $w) {
	//Add your code for this event here: 
	var audio = $w("#posiEn");
	audio.play();
}

but when I try it, it gives me “audio.play() is not a function”

What is the problem? and how I can play a sound?

Check out the following post and it’s comments. There’s a solution there.

We have just developed a dedicated no code solution to play sounds using various triggers.

What’s included:
• 7000+ professionally designed sounds across 50+ categories
• Click, hover, and scroll triggers for any element
• Page-specific ambient sounds
• Built-in on/off toggle button for visitors
• Volume control and sound preview
• Custom sound uploads
• Favorites system to save your go-to sounds
• Dark & light theme dashboard

Can be found in WIX app market:

Feel free to try it and share your thoughts :wink:

The error usually happens because the standard audio player element in Wix doesn’t always expose the .play() method the way you’d expect in Velo.

Try using the AudioPlayer element specifically. Also, keep in mind that most browsers (Chrome/Safari) will block audio on hover unless the user has clicked something on the page first. A quick fix is to have a ‘Mute/Unmute’ toggle or an ‘Enter’ button that triggers a silent sound first to ‘unlock’ the audio for the rest of the session!