How to use audio in html code playground | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to use audio in html code playground

I am having tremendous difficulty getting audio to work in the html/css/js code playground. I'm aware I have to put the audio file online in some way, but what exactly is the best way to do that? I've tried using onedrive, but the link onedrive gives me doesn't actually work as an audio file (and don't worry, I'm not using the embed option. I know that won't work). Same with dropbox. All it creates is an audio element that, when the audio is played, plays absolutely no audio. What steps should I take to put get my audio file working in the code playground?

18th Feb 2017, 11:21 PM
Jenni Zimmerle
Jenni Zimmerle - avatar
3 Answers
+ 4
Well, you have to find a host that just host your audio files, not a sharing service for listen on-line by users, but to be requested by web pages instead of ( directly ) users... Google drive isn't designed for that first purpose, most for the second, as well as they don't allow the first ^^ Anyway, you can cheat with creating a google site, upload files on it ( not linked with google drive, else you don't be able to retrieve a "real" link to it )... and that's it! :) Step by step here ( tested and approved: see snippet below ): http://www.mybloggerlab.com/2015/07/how-to-add-audio-files-to-posts-in-blogger.html <audio controls> <source src="https://sites.google.com/site/visphost/files/08.%20jaurai%20bien%20voulu.mp3?attredirects=0%26d=1" type="audio/mp3"> </audio> Accessory, to be valid, I've replaced the special char '&' in the url, by its url encoding format '%26' ^^
19th Feb 2017, 6:19 AM
visph
visph - avatar
+ 1
Have you tried a CDN? Not sure if playground supports sound though...
19th Feb 2017, 5:43 AM
Andre van Rensburg
Andre van Rensburg - avatar
0
Using Google Sites worked perfectly. Thanks!
19th Feb 2017, 7:39 PM
Jenni Zimmerle
Jenni Zimmerle - avatar