-
Notifications
You must be signed in to change notification settings - Fork 121
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
Loops stop working after stopping or playing audio over another #232
Comments
It sounds as though there may be an ordering mismatch between tracks in the event context and the audio task itself. I don't know when I'll have the time to dig into this, but if you add an event listener (state change, loop, etc.) you should be able to see what the Event side of the house believes your track state is. You can compare this with the output from |
Thanks for the answer. I'll give it a try in the weekend :) |
I've had this problem too. I tried having a look at it myself but I'm definitely too green with Rust to figure out what was going on. Only the first song played would loop: any others would not. |
I'm figuring that I'll have to update Songbird at some point for Discord's crypto so I'm having a look into this as it's pretty breaking for me. Here's a debug log for the actions
The "Firing Loop for [0]" repeats endlessly (multiple times per second) but no audio is played- something is getting stuck in a loop somewhere For comparison, when working (i.e, no play/stop/play sequence), the debug log is like so:
(Audio is a 2s loop so the event order here is correct) |
This has fixed it for me
Not done any sort of thorough testing. I've spent a while looking at the code without picking up much understanding, so wanted to ask if this looks like a reasonable oversight/issue (in which case I'll MR), or if this is going to cause further issues. My theory is that not clearing track_handles causes the loop in mix_tracks to attempt to perform seek on an orphaned track_handle in the looping logic, as it uses the index of the track (tracks.len eq 1), and not the index of the track_handle (track_handles.len eq 2) |
Clear `track_handles` when `SetTrack` heard, to prevent an issue where indices of `tracks` become desynced with those of `track_handles`. Closes #232.
Songbird version: 0.4.1
Rust version (
rustc -V
): rustc 1.75.0 (82e1608df 2023-12-21)Serenity version: 0.12.1
Output of
ffmpeg -version
,yt-dlp --version
(if relevant):Not using either of those, but just in case:
Description:
Loops stop working after running
stop
or playing another audio when one is already being played.This happens both for
LoopState.Infinite
, as well asLoopState.Finite(x)
forx > 0
.Steps to reproduce:
LoopState.Infinite
. They can be the same file.LoopState.Finite(0)
, not as expected withLoopState.Infinite
.LoopState.Infinite
doesn't work anymore. All tracks played after this will behave as ifLoopState.Finite(0)
.Additional Information
There are many other combinations that come to my mind, but I haven't tried them all. Let me know if I can help debugging this in any way.
The text was updated successfully, but these errors were encountered: