Closed szriru closed 1 year ago
First one looks like a bug. I need to investigate this tomorrow. For a quick fix, please set spinner parameter to False:
recorder = AudioToTextRecorder(spinner = False)
If it stops recording while you are still speaking, please raise the post_speech_silence_duration to a higher value. I suggest trying something around 1.5:
recorder = AudioToTextRecorder(post_speech_silence_duration = 1.5)
Last one, please try to use the recorder either in a with statement:
with AudioToTextRecorder(spinner = False, post_speech_silence_duration = 1.5) as recorder:
# your code
Or, alternatively, catch the KeyboardInterrupt Exception and shutdown the recorder manually:
try:
# your code
except KeyboardInterrupt:
recorder.shutdown()
I'll try to pin down the bug tomorrow and release a fixed version.
Thank you for reporting the issue. Please let me know if this helps. Have a nice evening!
Thank you for your reply.
The quick fix worked. Now I hope it'll be patched with a real fix soon.
I didn't notice the option. It worked. Thank you.
Still Ctrl+C cannot kill a process completely. I think it's possible because I'm using it in while statement. like:
try:
while True:
recorder.text(on_transcription_finished=on_transcription_finished)
except KeyboardInterrupt:
recorder.shutdown()
I checked that all threading instances of AudioToTextRecorder have daemon=True attribute. So I don't know why. This is not a main problem but its a little bit of troublesome for me.
(P.S. I noticed that you are creating LocalAIVoiceChat too. I'm also creating local llm ai voice chat things now but using oobabooga API, so its interesting for me. I'm looking forward to your works.)
Tried it for myself, you are right. I also can't terminate gracefully, I need to look deeper into this. Need some sleep now, I will investigate later. Thanks a lot for pointing this out.
Bugfixes for "AttributeError: 'NoneType' object has no attribute '_interval'" and "Cannot kill a process complety with Ctrl+C from windows 11 cmd" are now implemented.
Please upgrade to latest version with "pip install --upgrade realtimestt==0.1.7".
Everything works fine now! Thank you very much.
Almostly working fine, but I got an error several times when I was using this function
AudioToTextRecorder.text(on_transcription_finished=on_transcription_finished)
The error:
What is the problem?
And this has nothing to do with above one but it often stops recording while I'm still speaking. Could you teach me how to solve this problem too? ...and I cannot kill a process completely with Ctrl+C from windows 11 cmd
summary