Error Getting Mac OS X Sound Output
See original GitHub issueI made the following program in an attempt to try and retrieve all the audio that is being played on my Mac and replay it but everytime I run the code in main.txt, I run across the following output,
Default Devices:
> 0 Built-in Microphone, Core Audio (2 in, 0 out)
< 1 Built-in Output, Core Audio (0 in, 2 out)
Traceback (most recent call last):
File "main.py", line 15, in <module>
with sd.Stream(channels=2,dtype="float32",callback=callback):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/sounddevice.py", line 1654, in __init__
**_remove_self(locals()))
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/sounddevice.py", line 772, in __init__
'Error opening {0}'.format(self.__class__.__name__))
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/sounddevice.py", line 2563, in _check
raise PortAudioError(errormsg, err)
sounddevice.PortAudioError: Error opening Stream: Invalid number of channels [PaErrorCode -9998]
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
If you can't hear sound from your Mac speakers - Apple Support
Make sure the speakers are plugged into the audio output port on your Mac or display, and if necessary, into a power supply....
Read more >How to Fix Common Sound Issues on a Mac - MacKeeper
Go to Apple Menu → System Preferences → Sound → Output; You should see Internal Speakers as a device for sound output. If...
Read more >Audio & Sound Not Working in Mac OS X? It's an Easy Fix
First things first: make sure the Mac audio output is enabled and that the computer is not set to be mute. You can...
Read more >What To Do If Your Mac Sound Is Not Working | Macworld
Check System Preferences: Open System Preferences and click Sound. Click the Output tab and click on Internal Speakers. Check that Mute next to ......
Read more >Mac Sound Not Working? 7 Easy Fixes for Audio Problems on ...
At times, switching from one output to another can fix the problem. Also, try unplugging and reconnecting your audio devices. Remember to ...
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 FreeTop 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
Top GitHub Comments
@khlorghaal Do you mean the message
Invalid number of channels
?This message comes directly from the PortAudio library, so we cannot change it.
But we could probably do some additional checks before trying to create the stream. E.g. we could try to call
check_input_settings()
andcheck_output_settings()
. This way, the error message might contain information whether it’s about “input” or “output” channels. Do you think this would help?@khlorghaal I’ve created #242 to address your suggestion, but I’m not sure if it’s a good idea. Please express your opinions over there.