sphinx4 icon indicating copy to clipboard operation
sphinx4 copied to clipboard

frontend.util.Microphone needs to clean up before (re)starting recording

Open timobaumann opened this issue 7 years ago • 0 comments

frontend.util.Microphone does not clean its queue of data objects to be output when (re)starting recording.

When using that Microphone DataSource with endpointing, recognition may stop after SpeechEndSignal and leaves data objects in the queue when I then call stopRecording(). In particular, the old DataEndSignal is still there (before a new DataStartSignal appears followed by the new audio once recording resumes). The old DataEndSignal breaks recognition (or maybe already VAD?) even before the new data can be processed further down the pipeline.

The fix is to add

audioList.clear();

somewhere around line 444 (i.e., before creating the new recordingThread or before starting it). I'm happy to provide such a fix.

On another note: I filed this as https://sourceforge.net/p/cmusphinx/bugs/482/ but I'm unsure which of the bug trackers is currently used, so re-filing.

timobaumann avatar Apr 13 '18 18:04 timobaumann