-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reliably avoid audio pop/glitch at start/end of stream #455
Comments
- stop still audibly pops, see spatialaudio/python-sounddevice#455
Did you try different host APIs and different (virtual) devices? I have experienced clicks when starting/stopping streams on Linux, depending on the chosen device. If that's it, I think that's a deeper problem that cannot be solved from the Python side. It might even be a hardware issue, maybe some kind of DC offset that you hear when starting/stopping the stream? In general, I would recommend that you decouple the start of the stream from the start of your sound playback. If there is still a glitch when you start your playback while the stream has already been running, you should check the |
I did try different devices, and I think you're right that it probably depends on host API/device. I already decoupled the start of the stream from the start of the sound playback for the most important cases, which does help. Thanks! |
Hi, thanks for this package, which I'm currently using to prototype a pet project loop machine!
One thing that I haven't been able to avoid is an audible pop whenever I start/stop an
OutputStream
:I'm currently playing a simple sine sweep, at the start and end of which I've put a fade-in/out of 5ms.
There's no pop when looping, but often when starting, and always when stopping playback.
When stopping, I also only raise
sd.CallbackStop
after executing callbacks which run a fade-out of 5ms, yet there's still an audible pop.The code is a bit lengthy, but in principle the last code called inside the callback will look somewhat like this:
So the last
outdata
I canprint
before execution stops clearly shows the fade-out is applied, which makes me think that perhaps the last buffer isn't playing, or there's an extra/non-empty buffer playing after, which I don't have control over.Any ideas what this could be?
The text was updated successfully, but these errors were encountered: