I'm playing with a simple voice assistant model using pocketsphinx and festival. Livespeech listens through the mic and then festival.sayText() plays the phrase back through the speakers. This sets up a charming but useless feedback loop whereby pocketsphinx repeatedly attempts to decipher it's own utterances being picked up through the mic (I assume). I need to suppress the microphone before the festival.sayText() function plays, then restore it after. How do you do that.
I'm playing with a simple voice assistant model using pocketsphinx and festival. Livespeech listens through the mic and then festival.sayText() plays the phrase back through the speakers. This sets up a charming but useless feedback loop whereby pocketsphinx repeatedly attempts to decipher it's own utterances being picked up through the mic (I assume). I need to suppress the microphone before the festival.sayText() function plays, then restore it after. How do you do that.
You can call speech.ad.stop_recording before calling Festival:
https://github.com/bambocher/pocketsphinx-python/blob/769492da47e41b71e3dd57a6b033fbba79e57032/swig/sphinxbase/ad_base.i#L77