Closed risos8200 closed 1 year ago
I did use https://github.com/Uberi/speech_recognition/ with some modifications so it uses PyAudioWPatch instead of PyAudio, and added a Speaker parameter in the Microphone class in that file. Unfortunately PyAudioWPatch seems to be only for windows so this would be tough to set up on mac.
Yeah, I've been trying to change all dependencies to pyaudio which is available for mac, but facing some unexpected issues in the audiorecorder.py!
/Users/username/miniforge3/lib/python3.9/site-packages/whisper/timing.py:58: NumbaDeprecationWarning: The 'nopython' keyword argument was not supplied to the 'numba.jit' decorator. The implicit default value for this argument is currently False, but it will be changed to True in Numba 0.59.0. See https://numba.readthedocs.io/en/stable/reference/deprecation.html#deprecation-of-object-mode-fall-back-behaviour-when-using-jit for details.
def backtrace(trace: np.ndarray):
[INFO] Adjusting for ambient noise from Default Mic. Please make some noise from the Default Mic...
[INFO] Completed ambient noise adjustment for Default Mic.
[INFO] Adjusting for ambient noise from Default Speaker. Please make or play some noise from the Default Speaker...
Traceback (most recent call last):
File "/Users/username/ecoute/AudioRecorder.py", line 20, in adjust_for_noise
self.recorder.adjust_for_ambient_noise(self.source)
File "/Users/username/ecoute/custom_speech_recognition/__init__.py", line 401, in adjust_for_ambient_noise
assert source.stream is not None, "Audio source must be entered before adjusting, see documentation for ``AudioSource``; are you using ``source`` outside of a ``with`` statement?"
AssertionError: Audio source must be entered before adjusting, see documentation for ``AudioSource``; are you using ``source`` outside of a ``with`` statement?
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/username/ecoute/main.py", line 117, in <module>
main()
File "/Users/username/ecoute/main.py", line 76, in main
speaker_audio_recorder = AudioRecorder.DefaultSpeakerRecorder()
File "/Users/username/ecoute/AudioRecorder.py", line 70, in __init__
self.adjust_for_noise("Default Speaker", "Please make or play some noise from the Default Speaker...")
File "/Users/username/ecoute/AudioRecorder.py", line 20, in adjust_for_noise
self.recorder.adjust_for_ambient_noise(self.source)
File "/Users/username/ecoute/custom_speech_recognition/__init__.py", line 207, in __exit__
self.stream.close()
AttributeError: 'NoneType' object has no attribute 'close'
Getting this error when trying to run on a mac, anyone able to find a way around?
What is needed to get it working on Mac?
Maybe this code can be useful: https://github.com/leetcode-mafia/cheetah
I created a new issue to summarize what needs to be done to get it working on MAC https://github.com/SevaSk/ecoute/issues/10
Did you use the custom speech recognization from? https://github.com/Uberi/speech_recognition/blob/master/speech_recognition/__init__.py
If so, did you make any changes from the this? Trying to fix some issues for mac!