How to tell if sound effect is currently playing?

support for the gba/nds sound library from www.maxmod.org

Moderator: eKid

Post Reply
Derrik
Posts: 63
Joined: Wed Aug 14, 2013 8:28 pm

How to tell if sound effect is currently playing?

Post by Derrik » Thu May 22, 2014 7:42 pm

I am looking for a function which does this:

bool mmEffectFinished( mm_word sample_ID );

User avatar
Izhido
Posts: 107
Joined: Fri Oct 19, 2007 10:57 pm
Location: Costa Rica
Contact:

Re: How to tell if sound effect is currently playing?

Post by Izhido » Tue Oct 28, 2014 9:14 pm

So, have you had any luck finding such function? :)

Derrik
Posts: 63
Joined: Wed Aug 14, 2013 8:28 pm

Re: How to tell if sound effect is currently playing?

Post by Derrik » Thu Oct 30, 2014 11:07 pm

Izhido wrote:So, have you had any luck finding such function? :)
Nope. Without using a custom build of maxmod I don't think it is possible. I'm surprised MaxMod is missing such basic functionality when it is being pushed as the sound library to use for DS and GBA homebrew.

sverx
Posts: 94
Joined: Wed Aug 12, 2009 2:56 pm
Location: github.com/sverx
Contact:

Re: How to tell if sound effect is currently playing?

Post by sverx » Fri Oct 31, 2014 4:40 pm

what about modifying it? It shouldn't be too hard...

edit: in the source code, there's this

Code: Select all

mme_get_channel_index
which seems to me to receive the handler number in r0 and output the channel number on r3... so you just need to write a small wrapper to call this and check if the resulting value is !=-1 (invalid) ...

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests