Sound glitch at end of stream
See original GitHub issueI 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.
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:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top 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 >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
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
andCallbackAbort
exceptions.Any other ideas for improving the docs?
As always, I’m open for PRs …
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