natrys / whisper.el

Speech-to-Text interface for Emacs using OpenAI's whisper model and whisper.cpp as inference engine.
149 stars 10 forks source link

MacOS Ventura 13.6 needs explicit permission to access Mic #12

Closed doctorguile closed 1 year ago

doctorguile commented 1 year ago

I'm using Ventura 13.6 and the dictation function failed silently, it turns out that ffmpeg is getting killed with "abort trap: 6" because MacOS won't allow access to the mic unless the app requested it and user grant it explicitly.

And since emacs doens't do that by default we need to do something like this

https://superuser.com/questions/1441270/apps-dont-show-up-in-camera-and-microphone-privacy-settings-in-macbook

sqlite3 ~/Library/Application\ Support/com.apple.TCC/TCC.db

insert into access values  ('kTCCServiceMicrophone','org.gnu.Emacs', 0, 2, 2, 1, null, null, null, 'UNUSED', null, 0, 1698279008);

select * from access where service = 'kTCCServiceMicrophone' ;

.quit

BTW @rksm also provided his config which greatly helps with figuring out what value to set for whisper--ffmpeg-input-device

https://gist.github.com/rksm/04be012be07671cd5e1dc6ec5b077e34

I thought it might help if this gets mentioned in this repo somewhere or the readme for MacOS users

BTW it works flawlessly on Linux with zero config!

Cheers.

natrys commented 1 year ago

Thanks for this detailed guide. I have only ever tested this on Linux, so feedback like this is invaluable. I have summarised this issue in a wiki page and added links to sections in the readme:

https://github.com/natrys/whisper.el/wiki/MacOS-Configuration

But if you think something else could be added or fleshed out, feel free to edit the wiki :+1: