WebRTC-Experiment
WebRTC-Experiment copied to clipboard
only sampleRate = 44100 works for audio/wav on Mac in Chrome and Firefox
Hi, I'm working on sampling audio to audio/wav to send to this Speech-to-Text translator (it worked, finally!). I noticed that setting the sampleRate = 24000 lead to a 13 second recording being 27 seconds long and verrrrrrrrrrry distorrrrrted (my impression of the audio). Pretty much only 44100 Hz works but 48000 Hz sounds okay too.
Is this a known problem and can anything be done in the code to help this? My platform (Google Cloud API) will take lower frequency sample rates if the sound is correct, but maybe the timing is off somewhere? I am just familiarizing myself with the JavaScript code at https://github.com/streamproc/MediaStreamRecorder/blob/master/MediaStreamRecorder.js and I wanted to try OGG but I had difficulties on Chrome there too. But any working audio/wav with the LINEAR PCM codec or audio/ogg with the opus codec would be acceptable.
Thanks!
Please be aware that even 44.1 kHz leads to a little bit of distortion. From my testing it was about 10 seconds on 2 minute recording. Seems like using 48kHz is the solution, no time distortion at all