SevaSk / ecoute

Ecoute is a live transcription tool that provides real-time transcripts for both the user's microphone input (You) and the user's speakers output (Speaker) in a textbox. It also generates a suggested response using OpenAI's GPT-3.5 for the user to say based on the live transcription of the conversation.
https://github.com/SevaSk/ecoute
MIT License
5.89k stars 827 forks source link

Trying to run on MAC #3

Closed risos8200 closed 1 year ago

risos8200 commented 1 year ago

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!

SevaSk commented 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.

risos8200 commented 1 year ago

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!

risos8200 commented 1 year ago
/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?

Klaudioz commented 1 year ago

What is needed to get it working on Mac?

Maybe this code can be useful: https://github.com/leetcode-mafia/cheetah

SevaSk commented 1 year ago

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