Closed sloganking closed 6 months ago
Part of the error comes from cpal (which runs into an issue due to the unplug): https://github.com/est31/cpal/blob/7776c6634a8e21e2a585358545141fe091c38320/src/error.rs#L154
The way we interact with this error from Rodio is by passing in a handler (the error_callback
): https://github.com/RustAudio/rodio/blob/616ee267563555bf0edb803e7073dfbb27c6de9e/src/stream.rs#L211
Right that callback just prints the error. Whether to stop the stream or continue is cpal's choice. It does not seem to be something we can catch.
Feel free to re-open if you have any questions.
When my audio output device that I think is using is unplugged, my terminal prints the output.:
I'm not sure where this output is being printed from, presumably inside one of the Rodeo functions. I'm unwrapping on most of the exposed lib functions, so I don't know if this is something I can catch.
Is there a way to catch when a sync has gone bad, so that I can create a fresh working one?