Home Embed and autoplay a sound from freesound.org
Reply: 2

Embed and autoplay a sound from freesound.org

Alex
1#
Alex Published in 2018-01-12 09:51:01Z

I am looking for a way to embed a sound from the freesound.org page. Embedding is easy with the button "Embed" at the right bottom of each page. I am wondering if there's a way to autoplay the sound on my web page or if there's a javascript function I can use to make it play (and ideally pre-buffer it)? Thanks for your help!

The selected sound file should be loaded dynamically when a user enters the ID number of a freesound.org sound. The the corresponding sound file should be played automatically. The problem is that the embed play from freesound does not support autoplay and in order to autoplay a sound file vie e.g.

<audio preload="auto" autoplay="true" src="/path/to/audio"></audio> 

one would need the direct file link. But this link (the download link) is only available when one is logged in at freesound.org. Is it either possible to get this without being logged in or is it possible to start the embed play with a function call?

All the best, Alex

guest271314
2#
guest271314 Reply to 2018-01-12 10:01:44Z

You can use autoplay and preload attributes at <audio> element

<audio preload="auto" autoplay="true" src="/path/to/audio"></audio>
Aymen bz
3#
Aymen bz Reply to 2018-01-12 10:01:18Z

you can add autoplay attribute to audio element check this : w3schools

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.304441 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO