Skip to content

Is There A function to Initialize the audio and play the sound and uninitialize it , all in one function #433

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

You must be logged in to vote

They'll play simultaneously, but they wont be on their own thread - they're all mixed on the engine's internal device's thread. If you need it to wait for the previous one to finish you won't be able to use ma_engine_play_sound(). Instead you'd need to initialize a sound with ma_sound_init_from_file() and manage it yourself. You can periodically call ma_sound_at_end() to determine if it's at the end.

There's many different ways to do what you're needing. There's no need to use the high level API if it doesn't suit you - I just mentioned in case you might find it useful. If you want to use ma_decoder directly, just look at the return value of ma_decoder_read_pcm_frames() to determine if it…

Replies: 7 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by beemibrahim
Comment options

You must be logged in to vote
0 replies
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