-
Notifications
You must be signed in to change notification settings - Fork 837
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
Adding MAC OS support #10
Comments
I would like to try to work on this in my mac :) hope to start doing some tests later today |
for MacOS you can change in python code in AudioRecorder.py, AudioTranscriber.py and custom_speech_recognition/init.py
to disable windows only library and also add changes to requirements.txt to install pyaudio instead of pyaudiowpatch and some brew :
but still have error:
|
Likewise, after installing it on the Mac, I just left the pyaudio library, because it pyaudiowpatch was not installed and the error remained: [INFO] Adjusting for ambient noise from Default Mic. Please make some noise from the Default Mic... Help optimize |
@slawa-c i tried that workaround but still getting same error on req installation |
I'd love seeing this running on mac os 🙏 |
I did it on my Macbook, but without recognizing the sound from the speakers, only from the microphone. It also works fine if you output sound to an external speaker, but then the application does not distinguish between audio streams. I'm surprised it doesn't automatically detect the Whisper API 🤨 Here's a list of changes I made in addition to the tips above: AudioRecorder.py
AudioTranscriber.py
main.py |
Is there a way I can configure this on my Mac that currently runs on 12.6.6? Also, to configure I would require Xcode (supports 13 & above), any alternatives one could suggest? |
I had similar code and similar result. So here comes a bigger question: What's the Mac alternative for Windows WASAPI speaker loopback support. I did some quick research, unfortunately only Windows has decent SDK/API level support for speaker audio loopback. For Mac, I've read several recommendations (from Stackoverflow) that by installing virtual sound card or mixers, we can loop back audio from output device. Similar solutions on Linux too. I wonder if anyone could find more elegant solutions, like PyAudio patch or enhancement for this topic on Linux and Mac. Thanks! p.s. my code: https://github.com/oldsongsz/ecoute |
Everybody with successful tests here. How do you deal with |
I have a PR for getting it to work on mac |
I don't know if it would be helpful, but I wonder if something like Soundflower or it's 'cousin' Loopback would be helpful! Especially with seeing that it seems like audio can be 'heard' from a mic, but not the speakers, maybe turning the speakers into a mic would be a good thing to explore? |
I launch it in my M1 mac, just get a blank pannel
|
|
Hi Laisky, thanks a lot for your quick response. |
also I'm getting this error for
|
any one want to try it on mac, can check this https://github.com/clevertang/ecoute |
I used https://existential.audio/blackhole/ for collecting audio and selecting which channels I want to record |
So far seem to be making the most progress on this one. One of the things I've picked up that you can maybe add to documentation: You need to include an entry in the keys.py file denoting the device name. I found my device name by executing "system_profiler SPAudioDataType" in a terminal. My keys.py file has an entry now: |
And, hopefully this helps someone else on a Mac once day. If you're getting to the point where the interface is starting, but you're getting a blank window.. You're close and it's probably your version of Python that is outdated. I eventually settled on 3.11.1. In order to get there:
|
The reason this code does not run on macOS is because it relies on the PyAudioWPatch library for recording sound from speakers. This library specifically utilizes the Windows Audio Session API (WASAPI), enabling the use of output devices that support this API in loopback mode.
To make the code work on macOS, we would need a comparable feature that can record sound from speakers. The primary modifications would be required in the DefaultSpeakerRecorder class, where we currently use WASAPI to create the audio stream for recording. A potential solution could be leveraging tools like BlackHole to achieve similar functionality on macOS.
The text was updated successfully, but these errors were encountered: