Bink SDK 1.5v

Sound on the Xbox

Discussion

For sound support on the Xbox, Bink hooks directly to DirectSound. You don't have to to anything special at all - everything is handled automatically. If you aren't going to play a 5.1 soundtrack, then Bink will automatically route the default stereo or mono sound track to all of the 5.1 speakers. If you are going to play 5.1 soundtracks with Bink, then you need to setup the Bink file and your playback code using these tips. The first step in 5.1 playback is to make a Bink file that contains multiple audio tracks (check out the Audio-tracks-in-Bink section for more information on audio tracks). You use the Bink Sound Mixer to mix in each of the separate audio tracks. Author the multiple sound tracks like this: Track ID 0 - A stereo track containing the front left and front right channels. Track ID 1 - A mono track containing the center channel. Track ID 2 - A mono track containing the sub-woofer channel. Track ID 3 - A stereo track containing the back left and back right channels. Then, at runtime, you need to tell Bink to open all of the sound tracks simultaneously. To do this, use code something like this:


U32 TrackIDsToPlay[ 4 ] = { 0, 1, 2, 3 };
BinkSetSoundTrack( 4, TrackIDsToPlay );
bink = BinkOpen( "file.bik", BINKSNDTRACK );

Now we have to tell DirectSound where to route each of the sound tracks. To do this, use code like this:


U32 bins[ 2 ];
bins[ 0 ] = DSMIXBIN_FRONT_LEFT;bins[ 1 ] = DSMIXBIN_FRONT_RIGHT;BinkSetMixBins( bink, 0, bins, 2 );
bins[ 0 ] = DSMIXBIN_FRONT_CENTER;BinkSetMixBins( bink, 1, bins, 1 );
bins[ 0 ] = DSMIXBIN_LOW_FREQUENCY;BinkSetMixBins( bink, 2, bins, 1 );
bins[ 0 ] = DSMIXBIN_BACK_LEFT;bins[ 1 ] = DSMIXBIN_BACK_RIGHT;BinkSetMixBins( bink, 3, bins, 2 );

ExamXbox.CPP has example code to do all of this - check out the BINK51 code sections for details.

Next Topic (Memory management on the Xbox)

Previous Topic (Gamma on the Xbox)


Group: The Xbox Platform
Related Sections: Audio Tracks in Bink
Related Functions: BinkSetMixBins, BinkSetSoundTrack

For technical support, e-mail Bink1@radgametools.com
© Copyright 1994-2003 RAD Game Tools, Inc. All Rights Reserved.