Robotics StackExchange | Archived questions

How to inhibit/ignore speech recognition while generating speech

I am using Pocketsphinx for voice recognition, it seems to work well, and sound_play for text to speech. It also works. However, when doing text-to-speech, Pocketsphinx generates nuisance words (not the words spoken because it doesn't hear them clearly, I assume). This is done in hydro using c++.

I am trying to do a voice command/response where the robot asks its human a question and the human replies. Hence, I want to inhibit speech recognition until the robot has finished its question to avoid junk messages. I don't see anyway to do this in the api.

Can anyone tell me how to do this; or if there is a workaround to avoid my problem? Basically what I'd like it some logic to tell me when sound_play is done speaking.

Thanks, Alex

Asked by Alex Brown on 2014-06-25 15:33:04 UTC

Comments

Answers

I could not find any message which sound_play package publishes to inform about the state of the system(started, playing or stopped).
But since you are using pocketsphinx, what you could do as a workaround is this:
When you send the text message to sound_play, publish it on a topic and have pocketsphinx subscribe to it.
Whenever pocketsphinx gets data from this node, it stops processing the audio. As soon as it hears silence for few seconds, it starts processing again.

Asked by PankajBaranwal on 2017-06-13 08:08:36 UTC

Comments