question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Mac Mic Stream only giving indata as 0's

See original GitHub issue

I am using a streamer like this

self.audio_streamer = sd.Stream(device=self.input_device, channels=self.channels,
                                        samplerate=self.sampling_rate, dtype='int16',
                                        callback=self.update_audio_feed, blocksize=self.audio_block_size,
                                        latency='low')



def update_audio_feed(self, indata, outdata, frames, time, status):
        print("update_audio_feed")
        if status:
            print(status, file=sys.stderr)

        print(indata)
        outdata.fill(0)


Output :

The indata is an array with 0's always from the callback.
update_audio_feed
[[0]
 [0]
 [0]
 ...
 [0]
 [0]
 [0]]

Sounddevice is detectingt the mic fine but not getting the signal :
Device Info: {'name': 'MacBook Pro Microphone', 'hostapi': 0, 'max_input_channels': 1, 'max_output_channels': 0, 'default_low_input_latency': 0.04852607709750567, 'default_low_output_latency': 0.01, 'default_high_input_latency': 0.05868480725623583, 'default_high_output_latency': 0.1, 'default_samplerate': 44100.0}
Sampling rate: 44100.0 

Any ideas what is going on ? I checked that PortAudio is installed fine …

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
mgeiercommented, Jul 27, 2020

I’m not a macOS user myself, but I’ve heard about problems with the microphone permissions on macOS.

Maybe this helps: https://www.reddit.com/r/MacOS/comments/9lwyz0/mojave_not_privacy_settings_blocking_all_mic/

0reactions
vineyugavecommented, Aug 19, 2020

Issue on my Mac was a permission / security issue … when I ran the python script throught Visual Studio Code console it did not work … But when I ran it through mac Terminal it prompted for mic access and it started working …

Read more comments on GitHub >

github_iconTop Results From Across the Web

Change the sound input settings on Mac - Apple Support
On your Mac, choose a different sound input (such as a microphone) using the ... If your Mac has only one sound port,...
Read more >
Streaming audio from a microphone on a Mac to an iPhone
On the "playback" end, I don't think you can just pass buffers into the queue ... AQ might be able to give you...
Read more >
Microphone Not Working In macOS? | OnlineMicTest
It might be listening to the wrong microphone, or maybe its volume is too low. Try playing with that program's settings, or uninstalling...
Read more >
Download vMix Live Video Production Software
Visit vMix online today to download our vMix Software and our vMix Desktop Capture software! For more info about these products, visit vMix...
Read more >
Allow Teams access to camera, microphone and screen ...
Allow Teams access to camera, microphone and screen sharing in macOS. For macOS Catalina 10.15, Big Sur 11 or Monterey 12, Apple features...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found