shen zp
shen zp

Reputation: 11

Chrome browser cannot play wav audio files with 1000 sampling rate

I can see that the browser has loaded a wav file with a sampling rate of 1000, but the canplaythrough event cannot be triggered. Manually clicking the play button cannot play the wav file (the wav file with a sampling rate of 8000 can be played smoothly). After downloading the wav file with a sampling rate of 1000, it can be played with the player provided by the computer. Does chrome have playback restrictions on audio files with low sampling rate, or where the front-end and browser settings are wrong? Is there any way to let the browser play the wav file with 1000 sampling rate smoothly. I hope you can give me some ideas.

Upvotes: 1

Views: 1289

Answers (1)

CherryDT
CherryDT

Reputation: 29062

It doesn't clearly state so, but according to the Web Audio API specification, audio buffers with sample rates between 8000 and 96000 have to be supported. This is for programmatically creating such a buffer, but it's to be assumed that the same system is used internally when playing <audio> tags.

It's up to browser vendors whether they want to support sample rates outside of this range, but they don't have to (and apparently Chrome doesn't).

Note there are more constraints and browser differences in regards to supported codecs and file formats, for details see this and this page.

Upvotes: 0

Related Questions