Removing sources that are at the end of the Sink
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- rust
- Domain
- audio-video-rtc
Research direction
Start by reading the sink and source APIs described in the issue, especially how appended sources are queued and how EmptyCallback runs when a source ends. Explore whether the API supports removing a queued source while the current one plays without disrupting gapless playback. Done means the next source can be replaced during playback without stutters or silence; the issue names no files or tests to run.
Written by the indexing model from the issue text.
Description
Hi there!
I just had a brief issue dealing with the following situation:
- You create a new sink.
- You open two sources from files.
- Both sources are appended to the sink
- During playback of source 1, you decide that you want to remove source 2, and append a new source in its place.
However, I want to do this without interrupting the flow of playback. This is for a music player, so the possibility of the next upcoming song changing (say, because of a queue change) without interrupting the current playback (stutters, moment of silence, etc) is quite important. I would also like to keep the gapless playback functionality.
Right now, the only solution I could think of is having a secondary sink which is switched out, but this seems a bit cumbersome and likely to cause one of the issues I mentioned above. The way my player works right now is there is a Vec of song file paths (my 'lightweight' queue). When you add a song to this file path queue, it checks to see if the sink contains < 4 song sources in it. If it does, then it opens the file path into an actual source, and adds it to the sink. An EmptyCallback that sits after this then runs whenever the song source ends, and opens the next song path in the file path vec into a Decoder, which is then appended to the sink.
I do this so that I can have a very large queue that is easy to control (plus has song struct info in it) with minimal open file pointers, etc, but then the sink is constantly kept at 2 songs ready to go (unless there is only 1 left to play) so gapless playback works. This works well, but like I said, if I want to change the next song in the queue during playback of the first source, I am not sure how to remove the second source from the sink and append a new one in its place.
Thanks for all the hard work on Rodio - it's been incredibly helpful, and I've learnt a lot working with the library. Hopefully when I understand it a bit more fully I can contribute back to it too :)
- Dominant language
- Rust
- Stars
- 2.5k
- Forks
- 338
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from RustAudio/rodio
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 1/5 Under an hour Newbie friendliness 73/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
Difficulty 3/5 1-2 days Newbie friendliness 67/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
ci: migrate pinned macos-15 runners to macos-26 and macos-26-intelPossibly taken @hawkingrei claimed this today. Openenhancement
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
nowledge-co/hawdb#2224 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
eclipse-score/coverage_tool#95 ·
Maintainers usually reply within 2 days
-
bug nvim
Difficulty 2/5 1-3 hours Newbie friendliness 74/100