0
votes

We are trying to play back WAV files via the HTML5 audio tag. When we supply a 5kHz 16 bit mono WAV file, playback works perfectly. When we supply a 2.5kHz 16 bit mono WAV file, Chrome and Firefox both refuse to play it. The controls appear but nothing happens when the play button is clicked. Chrome can't seem to determine how long the WAV file is either, and fails to display the time elapsed/total.

Googling has not revealed anything about a lower limit on the frequency of audio data for HTML5 audio. In fact, it would seem like a useful feature to be able to play back low frequency audio because if higher frequencies are not needed there is no point transferring more audio data than necessary.

The only options we can think of are supply 5kHz WAV files (bad, we have millions of files and this wastes 50% disk space) or re-sample on the fly with Javascript somehow. Resampling on the server would create too much load.

1

1 Answers

0
votes

After much experimentation this appears to be a limitation of browsers. In order for HTML5 audio to work, audio has to be mixed. Mixing involves resampling to a common frequency. Resampling involves low pass filtering, and from what I can tell from the Chromium/Firefox source codes there is a lower limit on the low pass filter that prevents very low frequency WAV files from being played.

The only solution was to resample the WAV file to 5kHz ourselves.