-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pausing SOPARE #74
Comments
Never tried to pause SOPARE and there is no build in feature to do so. As pyAudio continues in your environment (as far as I understand) there is no reader attached and the input stream piles up. When SOPARE comes back it starts reading the piled up stream and you get the past input. Not sure how big the buffer in pyAudio and sub systems are so your findings may vary. If you just don't want to execute the predictions you could think about a flag in your custom plugin which can be set from an external instance/script/program... |
Will kill -CONT do the trick? Haven't tried it yet but might be interesting to test (im just too lazy to try it out 😀) |
@classicryder As pointed out in the question, SIGSTOP + SIGCONT is not an option because PyAudio seems to pass data anyways. And that's weird. I am proceeding as suggested by @bishoph . I am a newbie in Python 2.7. I have created a new plugin and, in init.py, I put this content:
and then, I have modified the recorder class this way:
The problem arises when I try to read
Now, I have spent so many hours trying to read the static variable Refs: |
In my application I need to stop SOPARE while another thread is executing.
Instead of calling every time
subprocess.Popen(['./sopare.py', '--loop'], stdout=subprocess.PIPE, ...)
I decided to send a SIGSTOP and then SIGCONT to SOPARE to make it stop and start over, avoiding to load PyAudio, which is quite heavy in terms of time on a Raspberry 3. My question is: is it the right way to freeze SOPARE? Or it must be done in a polite way, maybe via SOPARE plugins? It seems to me that, if I send SIGSTOP, then I speak for some seconds and then I send a SIGCONT to SOPARE, it also recognizes the words I said during the pause, which is not an expected behaviour
The text was updated successfully, but these errors were encountered: