Skip to content

No microphone permission prompt on macOS in Spyder/JupyterLab #574

@wooii

Description

@wooii

Description:
On macOS, recording audio with sounddevice does not trigger a microphone permission prompt and fails to record when run in Spyder or JupyterLab. This works as expected in VS Code and Jupyter Notebook.

Environment:

  • macOS: 15.1.1
  • Python: 3.12.7
  • sounddevice: 0.5.1
  • Spyder: 6.0.1
  • JupyterLab: 4.2.5

Steps to Reproduce:

  1. Run the following code in Spyder or JupyterLab on macOS.
  2. No permission prompt appears.
  3. Recording fails.
import sounddevice as sd
import matplotlib.pyplot as plt

duration = 3
fs = 16000
print("Recording...")
audio = sd.rec(int(duration * fs), samplerate=fs, channels=1)
sd.wait()

plt.plot(audio)
plt.show()

print("Playing...")
sd.play(audio, fs)
sd.wait()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions