gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Audio > apex AAS_SFX_GetNumChannels() fonction

#25949 - Mephisto - Wed Sep 01, 2004 7:20 pm

this code doesnt work
Code:
AAS_SFX_Play( AAS_SFX_GetNumChannels(), ..., ..., ..., ..., ...);

whereas
Code:
AAS_SFX_Play( 0, ..., ..., ..., ..., ...);

does

AAS_SFX_GetNumChannels() is supposed to return a available channel so why it does not work ?

#25968 - jd - Thu Sep 02, 2004 12:12 am

Mephisto wrote:

AAS_SFX_GetNumChannels() is supposed to return a available channel


No, it returns the number of channels that are available for you to use to play sound effects. E.g. if you specified AAS_CONFIG_CHANS_8 when you called AAS_SetConfig() and you're not playing a MOD then AAS_SFX_GetNumChannels() will return 8. If you were playing a 4 channel MOD in the same situation then AAS_SFX_GetNumChannels() would return 4.

The code you mentioned above will always fail because channels are numbered starting from 0 so if AAS_SFX_GetNumChannels() returns 8 then channels 0-7 are available for you to use for SFX as you see fit (attempting to play a sound on channel 8 will fail).

#25996 - Mephisto - Thu Sep 02, 2004 7:39 pm

oh thx