Skip to content

Initialize an ma_sound from a file, with notification callbacks #637

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

You must be logged in to vote

I've gone ahead and pushed a change to the dev branch. I can't change the ma_sound_init_from_file() API because I'm not ready to do a breaking API change, however I've got it so it should work with ma_sound_init_ex().

To use it, you would do something like this:

ma_sound_config config = ma_sound_config_init_2(pEngine);
config.pFilePath = pFilePath;
config.flags = flags;
config.initNotifications.done.pNotification = &myNotification;

result = ma_sound_init_ex(pEngine, &config, &sound);

It's a bit tedious, but it's the best I can do for now. The myNotification will be you custom object that extends from ma_async_notification_callbacks.

Note that I've not had a chance to properly test this yet.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

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

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