How can i change audio file quality to be 16 bit, stereo 8000 Hz using recorder.js?

504 Views Asked by At

I am using recorder.js/recorderworker.js the resulted quality is 16 bit, stereo 441000 Hz, how can change it to be 16 bit, stereo 8000 Hz?

2

There are 2 best solutions below

0
On

at file app.js you can config

audioContext = new AudioContext({sampleRate: 8000});
0
On

The constructor accepts a config object as the second parameter, as shown below. This will let you set it to stereo, and specify the sampling rate - but I'm not sure how to set it to 16bit (I believe this is the default).

var audioContext = new AudioContext();
var microphone = audioContext.createMediaStreamSource(stream);
recorder = new Recorder(microphone, { numChannels: 1, sampleRate: 8000 });