WebAudio streaming with fetch : DOMException: Unable to decode audio data

后端 未结 2 1701
情深已故
情深已故 2021-01-14 18:03

I\'m trying to play an infinite stream coming from the fetch API using Chrome 51. (a webcam audio stream as Microsoft PCM, 16 bit, mono 11025 Hz)

The code works almo

2条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-14 19:01

    AudioContext.decodeAudioData just isn't designed to decode partial files; it's intended for "short" (but complete) files. Due to the chunking design of MP3, it sometimes works on MP3 streams, but wouldn't on WAV files. You'll need to implement your own decoder in this case.

提交回复
热议问题