Skip to content

Chaining sounds #699

Answered by mackron
tuket asked this question in Q&A
Jun 30, 2023 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

You need to reset the chain's current data source: ma_data_source_set_current(mainMenu_Start.pDataSource, mainMenu_Start.pDataSource);

To give you some background, ma_sound_seek_to_pcm_frame() is just a wrapper around ma_data_source_seek_to_pcm_frame(). That function will only update the cursor of the data source you specify at a local level, meaning it does not consider the entire chain. Since your chain has moved onto the looping section, that looping section becomes the "current" data source in the chain, and since the "current" data source has not been reset, miniaudio will assume that it's still on the looping part of the chain.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@tuket
Comment options

Answer selected by tuket
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants