user8093442
user8093442

Reputation:

Audiocontext convert the sample rate from 44.1KHz to 8KHz

I'm trying to stream the microphone audio, but I noticed that the audio is recorded At 44,1KHz and the device to which I send the data only supports 8KHz audio data.

Is there a way to convert the sample rate by using JavaScript?

Upvotes: 0

Views: 1072

Answers (1)

David Sherman
David Sherman

Reputation: 440

You can downsample it using something like https://github.com/taisel/XAudioJS/blob/master/resampler.js if you want to do this in the browser. I'm just wondering what you could be sending to that only supports 8KHz directly from the browser. The web audio api only lets output (final output from browser) to the audiocontext's destination node which destination is determined by your system as far as I know.

Upvotes: 0

Related Questions