muaz-khan / WebRTC-Experiment

WebRTC, WebRTC and WebRTC. Everything here is all about WebRTC!!
https://www.webrtc-experiment.com/
MIT License
11.75k stars 3.95k forks source link

After Start/stopping the audio recorder on chrome, distortion occurs. #270

Open skunkworker opened 10 years ago

skunkworker commented 10 years ago

I have a recorder setup that works quite good the first couple times while recording in chrome using the separate audio/video recorders. After about the 3rd time and onward the audio from chrome becomes increasingly distorted. I am using Chrome 36 on Mac OS X 10.9.4. To reproduce: goto the web rtc website and record audio, then record audio again, after about the 3rd or 4th time there will be an increasing amount of distortion that is present, and eventually it will become so bad that audio and speech is intelligible. Now I don't know if this issue is chrome specific but I have a feeling it might be.

muaz-khan commented 10 years ago

Just pushed a commit to this repository. Please try it locally. Main RecordRTC.js hasn't yet been updated; so you can't test live demo.

muaz-khan commented 10 years ago

Here is an audio-recording demo that you can try locally:

<button id="start">Start</button>
<button id="stop" disabled>Stop</button>
<hr />

<audio id="audio" autoplay controls></audio>

<script src="RecordRTC.js" autoplay> </script>
<script>
document.querySelector('#start').onclick = function() {
    if (window.audioRecorder) {
        window.audioRecorder.startRecording();
        document.querySelector('#stop').disabled = false;
        return;
    }

    this.disabled = true;

    navigator.webkitGetUserMedia({
        audio: true
    }, function(stream) {
        document.querySelector('#audio').src = URL.createObjectURL(stream);

        window.audioRecorder = RecordRTC(stream);
        audioRecorder.startRecording();

        document.querySelector('#stop').disabled = false;
    }, function(error) {});
};

document.querySelector('#stop').onclick = function() {
    this.disabled = true;
    audioRecorder.stopRecording(function(url) {
        document.querySelector('#start').disabled = false;
        document.querySelector('#audio').src = url;
    });
};
</script>
karapetyan commented 9 years ago

@skunkworker what kind of distorsion you hear? distorsion occurs only when you talk something? please could you confirm that this record https://www.dropbox.com/s/5nxwczhixul4qg4/39-23-3483-es-1001.ogg?dl=0 have same distortion or it different from yours?

LordotU commented 9 years ago

@karapetyan these issue was resolved in @muaz-khan commit. We need to update our RecordRTC to the latest version.