Firefox error in HTML5 audio source

I have an HTML5 audio source that is defined as follows:

<audio> <source src="../audio/segment.mp3" type="audio/mpeg" /> <source src="../audio/segment.wav" type="audio/wav" /> </audio> 

.mp3 is for other browsers, and it is not expected to work. The .wav file is used to work without problems, but now this does not happen. I tried to iterate over FF change logs and havent found anything in recent releases. I am using FF 20 on Windows and now I get the following message:

 "Media resource http://website.com/segment.wav could not be decoded" 

If I throw URL.wav into the address bar, FF will play the file without any problems.

+4
source share
2 answers

Please note that during recording, FireFox will not play 24-bit .wav files. Convert them to 16 bits and they will be happy.

+3
source

I just ran into this situation: the WAV file plays when loaded directly in Firefox, but not in the <audio> element. The problem for me was that the 44-byte header of my WAV files was invalid. After making sure that the file length, byte and block alignment were correct, I was able to play them just fine.

Here is a description of the WAV header specification that I used: https://ccrma.stanford.edu/courses/422/projects/WaveFormat/ .

+2
source

Source: https://habr.com/ru/post/1479598/


All Articles