Jump to content
Sign in to follow this  
Guest

HTML5 AUDIO WAV ?

Recommended Posts

Guest

According to;     https://www.w3schools.com/html/html5_audio.asp

Edge/IE doesn't support WAV in the AUDIO element.

Is that true? Does a recent version of Edge/IE actually support WAV in AUDIO? I would prefer not to have to convert my WAV files to MP3.

Thanks for answers.

Share this post


Link to post
Share on other sites

I'm pretty sure that's true. Even if it were supported, I would recommend never using WAV because WAV files are uncompressed and would take up a whole lot of data/bandwidth for your users.

Share this post


Link to post
Share on other sites
Guest

According to;     https://www.w3schools.com/html/html5_audio.asp

Edge/IE, Chrome, Firefox, Safari, Opera all support MP3 files.

Chrome, Firefox, Safari, Opera support WAV files. However Edge/IE do not support WAV files.

I have coded a small HTML page at;     http://c-compiler.com/myfiles/mywav.html

which contains the code
 

Quote

 

<audio controls>

<source src="stgeorges-201219.wav" type="audio/wav">

Your browser does not support the audio element.

</audio>

 

When I load this page in MSIE, it says;   "invalid source"

When I load this page in Chrome, it gives a progress bar which doesn't work, without any way of actually hearing the WAV file.

When I load this page in Firefox, it gives a similar result to Chrome.

What is the reason for Chrome / Firefox not being able to play the WAV file?

I have coded a second small HTML page at;    http://c-compiler.com/myfiles/mymp3.html

which contains the code

Quote

<audio controls>
   <source src="stgeorges-201219x.mp3" type="audio/mpeg">
 Your browser does not support the audio element.
</audio>

When I load this page in MSIE, Chrome and Firefox, it works fine for all three.

I suppose it's unequivocal that my website should use MP3, which works well for all browsers tested, and not WAV, which doesn't work at all in IE and doesn't work properly in Chrome and Firefox.

Perhaps Ingolme or another web coding expert could confirm that my understanding of this issue is correct.

Thank you.

 

Share this post


Link to post
Share on other sites

Firefox says "Media resource http://c-compiler.com/myfiles/stgeorges-201219.wav could not be decoded."

I'm not an expert in audio and video encoding, it's a complicated subject, but I would guess that the encoding used by the WAV file was not supported by the browser. According to this mozilla ticket: https://support.mozilla.org/en-US/questions/1228379

Quote

There are lots of options (number of channels, sample rate) for creating WAV files and Firefox doesn't support them all, only a small set of commonly used formats is supported. So you can try to use two channels and 48k sampling rate.

 

Share this post


Link to post
Share on other sites
Guest
11 hours ago, Ingolme said:

Firefox says "Media resource http://c-compiler.com/myfiles/stgeorges-201219.wav could not be decoded."

I'm not an expert in audio and video encoding, it's a complicated subject, but I would guess that the encoding used by the WAV file was not supported by the browser. According to this mozilla ticket: https://support.mozilla.org/en-US/questions/1228379

 

My WAV file is on an ADPCM  codec, which is not decoded in MS IE, and apparently not in Firefox either.

I would like to verify that I should not use WAV  in the AUDIO element, that I should use MP3. Please could you confirm that for me.

Share this post


Link to post
Share on other sites

Internet Explorer does not support WAV, other browsers do. If it's just for browser compatibility you can use WAV files if you don't care to support Internet Explorer or Microsoft Edge.

As for whether you should use it, I would recommend against it. The files take longer to load for the user and they take up a lot more bandwidth on the user's end. Many people have data caps, so it is a good idea not to waste it unnecessarily.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...