Change sample rate of AudioContext (getUserMedia)

后端 未结 7 2232
粉色の甜心
粉色の甜心 2020-12-08 10:07

Im trying to record a 48000Hz recording via getUserMedia. But without luck. The returned audio MediaStream returns 44100Hz. How can i set this to 48000Hz?

Here are s

7条回答
  •  庸人自扰
    2020-12-08 10:39

    You can use an OfflineAudioContext to essentially render your audio buffer to a different sample rate (but this is batch operation).

    So you would record your recording using the normal audio context, and then use an OfflineAudioContext with a different sample rate to render your buffer. There is an example on the Mozilla page.

提交回复
热议问题