0

I am using pexpect in python to receive continuous audio data from an audio input for my home automation project. Is there a way to pause the pexpect from using my audio device? Or can I use the audio device in two separate programs/scripts?

What I want to do is: Use speech recognition (julius) to listen for keywords. For more complex commands I want to use Google's Speech to Text API because of a higher accuracy. Both things work perfectly fine separately.

What my problem is: Once the keyword is found, audio data needs to be recorded and send to the Google API. However, I have only one audio device and this is already used by the speech recognition with julius. I cannot .close and .spawn the speech recognition, because it takes a long time to load. Is there any chance the pexpect can be paused? Or do you guys know any other workaround?

Bests, MGG

Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140
  • So you're running `julius` under pexpect, and watching for some particular output? Are there Python bindings? That might give you more control over what it's doing. – Thomas K Mar 21 '14 at 19:06

1 Answers1

0

A workaround for my problem was the following: using dsnoop for ALSA audio settings in .asoundrc.