The README has a nice example of recording audio, but it does not work on a Mac if you run it from a julia session in an xterm under XQuartz. The reason is that MacOS requires explicit permissions apps to access the microphone and it seems that XQuartz is not smart enough to ask for such permission.
Running julia and then recording from a Terminal worked fine because Terminal asks for permissions (see Privacy tab under Security in MacOS system preferences).
Anyone trying to access the microphone on a system with such permissions may face this issue.
It would be ideal if PortAudio could check to see if it has permission to access the microphone and report an error if it cannot (there must be a way to do this). What is happening instead is that PortAudio just records silently and returns all zeros. And the real time spectrum example just shows an empty plot.
The README has a nice example of recording audio, but it does not work on a Mac if you run it from a julia session in an xterm under XQuartz. The reason is that MacOS requires explicit permissions apps to access the microphone and it seems that XQuartz is not smart enough to ask for such permission.
Running julia and then recording from a Terminal worked fine because Terminal asks for permissions (see Privacy tab under Security in MacOS system preferences).
Anyone trying to access the microphone on a system with such permissions may face this issue.
It would be ideal if PortAudio could check to see if it has permission to access the microphone and report an error if it cannot (there must be a way to do this). What is happening instead is that PortAudio just records silently and returns all zeros. And the real time spectrum example just shows an empty plot.
Perhaps this is really an issue for http://www.portaudio.com ?
Addendum: link to microphone access check: https://developer.apple.com/documentation/avfoundation/cameras_and_media_capture/requesting_authorization_for_media_capture_on_macos