How to play back list of files #302
-
I need to implement simple play back machine with a play list.
Second, how and even can i reuse all this decoder, config and device staff to play different files or i need to uninitialize/initialize all them each time i need to play next file? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
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 When the track has changed you'll need to do a full reinitialization of a fresh |
Beta Was this translation helpful? Give feedback.
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 ofma_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…