Skip to content
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

Trying to run on MAC #3

Closed
risos8200 opened this issue May 21, 2023 · 5 comments
Closed

Trying to run on MAC #3

risos8200 opened this issue May 21, 2023 · 5 comments

Comments

@risos8200
Copy link

risos8200 commented May 21, 2023

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
Copy link
Owner

SevaSk commented May 21, 2023

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
Copy link
Author

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
Copy link
Author

/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?

@risos8200 risos8200 reopened this May 21, 2023
@Klaudioz
Copy link

What is needed to get it working on Mac?

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

@SevaSk
Copy link
Owner

SevaSk commented May 22, 2023

I created a new issue to summarize what needs to be done to get it working on MAC #10

@SevaSk SevaSk closed this as completed May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants