Skip to content
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

Mac app doesn't request microphone permissions once app is compiled, fails to hear anything. #6

Open
AmberSahdev opened this issue Apr 15, 2024 · 0 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@AmberSahdev
Copy link
Owner

Microphone access works when I run it using just the script app.py, but is non-responsive once I package the app.

So far I have tried

  • Changing the .spec file manually and adding
info_plist={
    'NSMicrophoneUsageDescription': 'This application requires microphone access to convert speech to text.',
},
  • Editing the Info.plist directly with
<key>NSMicrophoneUsageDescription</key>
<string>This application requires microphone access to convert speech to text</string>
  • Writing explicit functions to trigger permission request
def request_mic_permissions(self):
    import pyaudio
    pa = pyaudio.PyAudio()
    try:
        stream = pa.open(format=pyaudio.paInt16, channels=1, rate=44100, input=True, frames_per_buffer=1024)
        print("Requesting microphone permissions...")
        data = stream.read(1024)  # Attempt to read from the microphone to trigger the permission request
        stream.close()
        print("Microphone access granted.")
    except Exception as e:
        print(f"Failed to access microphone: {e}")
    finally:
        pa.terminate()

But none of these have yet succeeded.


This post suggests adding an entitlements.plist but my microphone access request isn't working even before code signing and notarization.

Screenshot 2024-04-15 at 12 32 38 AM
@AmberSahdev AmberSahdev added bug Something isn't working help wanted Extra attention is needed labels Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant