.wav file not playing in audio element in HTML 5

Viewed 11503

I am using following code to play the .wav file using the HTML5 audio player.

 <audio controls autoplay>
    <source src="test.wav" type="audio/wav">
    Your browser does not support the audio element.
</audio>

The file is not played in the browser. I tried this in both IE Edge and Chrome and it does not work in both.

If I try the .mp3 format that works. The documentation on internet seems to suggest that .wav format is supported.

Is there some thing wrong in my code. Can we play .wav files in IE Edge and Chrome using the HTML5 audio element?

Also if I directly open the .wav files in the browsers, then also the files are not played.

Thanks for your time, let me know in case any other information is needed.

Edit: I seems like there is some problem in my wav files because if I try files from http://freewavesamples.com/files/Kawai-K11-CleanGtr-C3.wav then it works but not with my local wav files.

3 Answers

No, IE / Edge does not support WAV files. See https://www.w3schools.com/html/html5_audio.asp , the only common format is MP3.

Oddly enough, WAV is supported by all the other browsers which is strange because WAV is primarily a Windows thing.

Related