ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

How to inhibit/ignore speech recognition while generating speech

asked 2014-06-25 15:33:04 -0600

Alex Brown gravatar image

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

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-06-13 08:08:36 -0600

PankajBaranwal gravatar image

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.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2014-06-25 15:33:04 -0600

Seen: 1,948 times

Last updated: Jun 13 '17