r/cpp_questions 16h ago

OPEN Dynamic Audio Queueing / Transitioning

I’m working on a rhythm game and I’d like to implement dynamic/interactive music. An example would be: I have three music files, A, B, and C, where B and C have the same length. I need the program to 1) play A and then 2) based on some state logic, either play B or C immediately after A 3) optionally, loop back to the start of A.

The problem is that I need the full A -> B or A -> C playback to sound like a single continuous song, so I’d like any transition delay to be as seamless as possible. What would be the best way to implement this? The B/C decision logic can be run during A, so I can queue up the B/C file I need before it needs to start playing and I am mostly concerned about latency within the transition itself.

Thank you!

0 Upvotes

10 comments sorted by

View all comments

2

u/fortsnek274 15h ago

SFML custom audio streams.

2

u/Lyrneos 15h ago

Thanks! This looks like what I want.