Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sound capture. MacOS permissions. Java Audio API

I'm trying to capture sound from microphone via Java Sound API. I'm using sample code from github and it works perfect on Windows system, but when it runs on MacOS - audio-line buffer returns zero-bytes.

Also if I compile project to jar and run it via administrator permission - appears a message to give access to microphone and after I grant it - all works.

So the question is how to make permission request from code and run app without sudo?

Thanks!

like image 225
Viktor Avatar asked Aug 23 '19 19:08

Viktor


1 Answers

BTW, you have to use the default terminal that comes with mac to execute jar file. That will worked.

The third party terminal, such as iTerm, it's not ok.

like image 97
vincent Avatar answered Oct 22 '22 12:10

vincent