Skip to content

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

Description

@AmberSahdev

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions