Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Echo or noise in recorded audio #13

Open
alerenato opened this issue Nov 29, 2017 · 4 comments
Open

Echo or noise in recorded audio #13

alerenato opened this issue Nov 29, 2017 · 4 comments

Comments

@alerenato
Copy link

Hello,
I was trying to use the demo doing "Start" and "Stop". The first sentence is correct, but the rest, when listening to the audios, have problems or deletion or echo. Looking at the code and making some queries on the internet (there are several people who have the same issue with getMediaUser) I found that "Stop" could not be pushing the remaining audio, and placed the new audio in the previous "stream". I added a line of code (dictate.js) and the problem is apparently solved.

// Stop recording
if (recorder) {
recorder.stop();
config.onEvent(MSG_STOP, 'Stopped recording');
// Push the remaining audio to the server
recorder.export16kMono(function(blob) {
socketSend(blob);
socketSend(TAG_END_OF_SENTENCE);
recorder.clear(); // Line added
}, 'audio/x-raw');
config.onEndOfSpeech();
} else {
config.onError(ERR_AUDIO, "Recorder undefined");
}
}

I would like to know if you have experienced the same issue and if this solution could be correct. Thanks to advances.

@Kaljurand
Copy link
Owner

Thanks for pointing this out! Now that I'm trying it (with Chrome 62.0.3202.94), I also see that sometimes "++garbage++" is being recognized. However, I don't understand what did you change, e.g. your "added line" is already part of the current code (

recorder.clear();
). Can you offer a pull request to make your change easier to follow? Also, can you point to the internet resources that describe the problem/solution?

@alerenato
Copy link
Author

Excuse me, the line added is wrong. I will try to open a pull request, but for now, I don't know to do.

140 socketSend(TAG_END_OF_SENTENCE);
141 recorder.clear();
142 }, 'audio/x-raw');
143 config.onEndOfSpeech();
recorder.clear(); // line added

There is another problem with echo and noise. In the function getUserMedia is necessary to change "googEchoCancellation", "googAutoGainControl", "googNoiseSuppression" to false. I changed some lines too in dictate.js. If I can't open a pull request I will try to send you.

There are some internet resources:
https://support.twilio.com/hc/en-us/articles/223180868-How-to-constrain-the-audio-sources-in-Google-Chrome-
https://stackoverflow.com/questions/31426551/get-consistent-audio-quality-with-getusermedia-using-different-browsers

Thanks in advance.

@YunzhaoLu
Copy link

Bother to mention this issue again.
Seems that it works fine in the beginning a few minutes, and it becomes worse with echo/noise after 10 to 20 minutes.
Does anyone get this kind of issue?
Thank you.

@YunzhaoLu
Copy link

To initialize the sampleRate at 16000 to bypass resampling can mitigate the echo/noise around 20 minutes. However, there is longer delay of transcripts after 20 minutes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants