Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ma_sound_set_end_callback should be called on ma_sound_stop #897

Open
reg31 opened this issue Sep 22, 2024 · 2 comments
Open

ma_sound_set_end_callback should be called on ma_sound_stop #897

reg31 opened this issue Sep 22, 2024 · 2 comments

Comments

@reg31
Copy link

reg31 commented Sep 22, 2024

The callback is not triggered after calling ma_sound_stop, it is called only when we reach the end of the audio file.
This may cause a race cindition as we do not know at this point if the audio thread is properly stopped.

@reg31
Copy link
Author

reg31 commented Sep 24, 2024

I found my answer:

ma_engine_init(nullptr, &engine);
engine.pDevice->onNotification = &on_notification;

@mackron
Copy link
Owner

mackron commented Oct 11, 2024

That technique is not technically the right way to do it, but probably won't cause any issues. Typically you would configure that via the device config, but that is inconvenient because you would need a self-managed device in that case. A better solution might be for the onNotification callback to be added to ma_engine_config. I'll leave this issue open to remind me to consider adding support for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants