mic isn't recording audio
See original GitHub issueThis is the code (I’ve taken it from the docs)
import soundcard as sc
import numpy
# get a list of all speakers:
speakers = sc.all_speakers()
# get the current default speaker on your system:
default_speaker = sc.default_speaker()
# get a list of all microphones:
mics = sc.all_microphones()
# get the current default microphone on your system:
default_mic = sc.default_microphone()
data = default_mic.record(samplerate=48000, numframes=48000)
default_speaker.play(data/numpy.max(data), samplerate=48000)
when I run the code the sound does not play. At first I thought this was a problem with the speaker object but then I tried playing a saved wav file separately using the speaker object and it worked but when I try to play the mic input there is no sound output, also there is this warning
/Users/faizrahim/PycharmProjects/voice-lag-simul/writejson.py:15: RuntimeWarning: invalid value encountered in true_divide
default_speaker.play(data/numpy.max(data), samplerate=48000)
The data
variable when printed returns an array with nothing other than 0.0
[[0.]
[0.]
[0.]
...
[0.]
[0.]
[0.]]
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (9 by maintainers)
Top Results From Across the Web
Microphone not picking up voice [Solved] - Driver Easy
Troubleshoot mic problems · Method 1: Update your audio driver. A missing or outdated audio driver may stop mic from picking up voice....
Read more >How to Fix Windows 10 Voice Recorder Not Working
1. Update Windows Driver · 2. Make Sure Microphone is Enable · 3. Adjust Microphone Levels · 4. Select the Correct Recording Device...
Read more >What To Do If Your Mic is Not Working on Windows 10 - A Guide
You can go to Control Panel > Hardware and Sound > Sound where you can find the headset listed in the recording devices...
Read more >No Sound When Screen Recording on Windows 10
How to fix the Windows voice recorder not working? · 1. Enable microphone/recording device · 2. Update your drivers · 3. Grant audio...
Read more >How to Fix It When a Windows 10 Microphone is Not Working
Run the Windows 10 troubleshooter. · Look for a Mute button. · Check your connections. · Check individual app settings. · Change your...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes the real problem is the most common places where people run their scripts on macos is from vscode (that has a well documented bug since macos Mojave) and iterm that also doesn’t ask for permission.
I try to fix this at script level so that soundcard ask for it regardless of the top application in the meantime I add the workaround to the readme.
I’m ok with closing this