Bink SDK 1.5v |
For sound support on the Nintendo GameCube, Bink can talk to either the AX audio library or MusyX audio library which in turn talks to the GameCube hardware. Note that the GameCube's hardware DSP runs at 32028 Hz, so any audio frequencies higher than that simply get filtered out. This means you should usually preconvert your audio tracks down to 32028 Hz at authoring time (but Bink can down-convert audio tracks at runtime for a small CPU hit, though). Now let's describe the steps to get AX or MusyX support working (you should also check out ExamNbb.C - it's a simple example that can support AX or MusyX). To use Bink's built-in AX support, you have to perform these three steps (only the third step if you are already playing audio with AX): 1) You have to set up the audio hardware subsystems prior to calling into Bink. This means calling the following code:
ARInit( aramMemArray, MAX_ARAM_BLOCKS ); ARQInit( ); AIInit( 0 );
2) Next, you must set up the AX library prior to calling Bink. You also usually want to turn the dynamic compressor off for pre-authored. This code looks like this:
AXInit( ); AXSetCompressor( AX_COMPRESSOR_OFF );
3) Finally, you need to tell Bink to actually use AX by calling the BinkSoundUseAX function. This function also needs the two callbacks to use for requesting audio buffer RAM. So, the code for this step looks something like this:
void *aram_malloc( U32 num_bytes ) { return( ( void * ) ARAlloc( num_bytes ) ); }
void aram_free( void * ptr ) { U32 length; ptr = ptr; // ARFree always frees the last pointer allocated ARFree( &length ); }
RADARAMCALLBACKS aram_callbacks = { aram_malloc, aram_free }; BinkSoundUseAX( &aram_callbacks );
And that's it - the AX users should be hearing sound now! The setup for MusyX users is just as easy. To start Bink's support for MusyX, follow these similar 3 steps (again, only the third step is necessary if you are already playing audio with MusyX): 1) You have to set up the audio hardware subsystems prior to calling into Bink. This means calling the following code:
ARInit( aramMemArray, MAX_ARAM_BLOCKS ); ARQInit(); AIInit( 0 );
2) Next, you must set up the MusyX library prior to calling Bink. This code looks something like this:
sndSetHooks( &ram_callbacks ); sndInit( 16, 8, 8, 1, SND_FLAGS_DEFAULT, 8 * 1024 * 1024 );
3) Finally, you need to tell Bink to actually use MusyX by calling the BinkSoundUseMusyX function. The code for this step is simply:
BinkSoundUseMusyX( );
And that's it - Bink takes care of everything else!
Next Topic (Memory management on the Nintendo GameCube)
Previous Topic (Gamma on the Nintendo GameCube)
Group:
The Nintendo GameCube Platform
Related Sections:
Audio Tracks in Bink
Related Functions:
BinkSoundUseAX, BinkSoundUseMusyX
For technical support, e-mail Bink1@radgametools.com
© Copyright 1994-2003 RAD Game Tools, Inc. All Rights Reserved.