I am trying to capture user audio recording using MediaRecorder
object.
I did the following
navigator.mediaDevices.getUserMedia({
audio: {
channelCount: 1,
sampleSize: 16
}, video: false
}).then(stream => {
var track = stream.getAudioTracks()[0];
track.applyConstraints({
channelCount: 1,
sampleSize: 16
});
// Tired to use getSupportedConstraints(), but sampleRate is undefined
console.log(navigator.mediaDevices.getSupportedConstraints().sampleRate);
});
From researching, it seems that I can’t set the sampleRate
for the recorder as the client may not support it. So how can I get the current sampleRate
that the recording was captured with?