muaz-khan / RecordRTC

RecordRTC is WebRTC JavaScript library for audio/video as well as screen activity recording. It supports Chrome, Firefox, Opera, Android, and Microsoft Edge. Platforms: Linux, Mac and Windows.
https://www.webrtc-experiment.com/RecordRTC/
MIT License
6.58k stars 1.76k forks source link

Recording multiple tracks using StereoAudioRecorder leads to white noise #588

Closed maitham closed 4 years ago

maitham commented 4 years ago

Creating two new streams using two different media tracks i.e. calling the same code below twice for two separate streams results in white noise for the second stream.

const stream = new MediaStream([track]);

        const options = {
          type: "audio",
          mimeType: "audio/wav",
          timeSlice: 1000,
          recorderType: StereoAudioRecorder,
          desiredSampRate: 16000,
          numberOfAudioChannels: 1,
          ondataavailable: blob => handler(blob, socket)
        };
        const recorder = new RecordRTC(stream, options);
        recorder.startRecording();