Skip to content

How to play back list of files #302

Answered by mackron
pavelmazurov1 asked this question in Q&A
Discussion options

You must be logged in to vote

Devices and decoders are entirely decoupled. While the device is running, the callback will continuously get fired until the device is stopped or uninitialized. From inside the callback you can read from the ma_decoder object and output to the callback's output buffer, exactly like the simple_playback example. You can know if the end of the file has been reached by checking the return value of ma_decoder_read_pcm_frames(). That will return the number of PCM frames actually read. If it's less than what you requested it means you've reached the end and you can change to the next track.

When the track has changed you'll need to do a full reinitialization of a fresh ma_decoder object. Make su…

Replies: 1 comment 1 reply

Comment options

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

Answer selected by pavelmazurov1
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