0

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?

Amir
  • 1,328
  • 2
  • 13
  • 27
  • Can you not record it in the supported format to begin with? – Nope Jun 06 '17 at 15:50
  • I'm using "audiocontext" to record the microphone data and according to the documentation the default sample rate is set to 44.1Khz and no way to set it to 8KHz. I think the only solution for me is to convert the data. –  Jun 06 '17 at 16:31
  • I use audacity and it should be able to either record in 8Khz or at least be able to export into 8Khz - Also, while this is a thread for an older version of Audacity the same logic could still apply. Set the preferred Khz Rate in the bottom left of audacity and then export as required ► http://forum.audacityteam.org/viewtopic.php?f=16&t=61480 – Nope Jun 07 '17 at 10:08
  • Indexes with audio software l'île audacity ils possible to export a record in 8kHz but chat im trying to do is to record without software only using javascript –  Jun 07 '17 at 19:31

1 Answers1

0

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.

David Sherman
  • 320
  • 2
  • 9