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!
javac AudioCapture01.java
and run withjava AudioCapture01
without issue.java version "1.8.0_162" Java(TM) SE Runtime Environment (build 1.8.0_162-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.162-b12, mixed mode)
on macOS High Sierra. It might be worth checking everything is up to date. and making sure nothing extra has been added to the example code first. – Artillery