Page 2 of 2

Re: Play a sound file from Rich Display File App

Posted: Tue Mar 21, 2017 3:54 pm
by smohsen
This is my code below in onclick event of button. Attached is the screenshot of the tada.wav file location.
It looks this time I coded properly. But still no success.

var sound = new Audio('/test/tada.wav');
sound.play();

Thanks.

Re: Play a sound file from Rich Display File App

Posted: Wed Mar 22, 2017 4:04 pm
by Scott Klement
I don't see anything obvious wrong with what you posted.

What is the error? Have you looked in the browser's developer tools to see what the error is?

Re: Play a sound file from Rich Display File App

Posted: Wed Mar 22, 2017 5:04 pm
by smohsen
I just looked and found following error message in Console tab:
"MEDIA12899: AUDIO/VIDEO: Unknown MIME type:"

Re: Play a sound file from Rich Display File App

Posted: Wed Mar 22, 2017 6:12 pm
by SeanTyree
According to this page: https://www.w3schools.com/html/html5_audio.asp IE does not support WAV files.

Sean

Re: Play a sound file from Rich Display File App

Posted: Thu Mar 23, 2017 2:49 am
by Scott Klement
Yes, if you still use Internet Explorer (which Microsoft has discontinued, and wants people to stop using) then you may have to use an MP3 file instead of WAV. But, it should work fine in other browsers.

Re: Play a sound file from Rich Display File App

Posted: Thu Mar 23, 2017 10:00 am
by smohsen
.MP3 works with both IE and Chrome and .WAV works with Chrome.
Thank you all for your patience and help.