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.

Sound glitch at end of stream

See original GitHub issue

I found that, occasionally (4/10 times), a crack could be heard when the stream was closed. I was able to resolve this (0/10 tries) by writing a frame of zeros before calling sd.CallbackStop.

I was writing sine waves with a fade out and recording the resulting sound. Here is an example of the cracking sound. Data sent to outdata is shown (top track) against the recorded sound (bottom track). They have only been aligned by eye.

image

It seems that a solution was to write a frame of all zeros: outdata[:] = [[0,0]] * samples

And then in the next call of the callback: raise sd.CallbackStop

Operating system: macOS 10.13.6 PortAudio version: PortAudio V19.6.0-devel (installed via brew)

I hope that’s helpful to someone else.

Cheers,

Matthew

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
mgeiercommented, Jun 30, 2020

Thanks for the update! That’s good news!

I’d like to keep this issue open for now as a reminder to make this problem more visible in the docs.

I think this should be at least mentioned in the documentation of the CallbackStop and CallbackAbort exceptions.

Any other ideas for improving the docs?

As always, I’m open for PRs …

0reactions
mattgwwalkercommented, Jun 27, 2020

I have been looking out for this issue for the last two weeks and actively filling the buffer with zeros seems to be the solution.

I think this issue can be closed.

Cheers,

Matthew

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix Live Stream Audio Problems and Sound Better
The common cause of most echo-related audio issues is your mic picking up unintended sounds. For example, if your streaming is playing back...
Read more >
How to Fix Audio Issues on Your Live Stream - BoxCast
Try these troubleshooting tips for your live stream audio: Fix levels that are too high or low, audio buzzing, or how long to...
Read more >
Why is the audio breaking up or choppy sometimes?
Typically the receiver's connection is stalling due to over-utilization. Alternately, the listener's audio equipment may be malfunctioning due to a faulty cable ...
Read more >
Streaming video sound cutting out and other problems
Method 2. Try updating the Audio drivers from the manufacturer's website and check if the issue persists. Follow the steps to update the...
Read more >
Fix OBS Live Stream Audio That's Out Of Sync. PERMANENTLY
Fix OBS Live Stream Audio That's Out Of Sync. PERMANENTLYAudio Sync issues are the most common complaint you find for OBS.
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