Sep
30
2008

Athena: Playing Sound with FMOD Soundbanks

Using the Soundbank

Finally to play an event in a soundbank, all that is needed is to have the Audio Manager initialised, load a soundbank successfully, and retrieve an event from the soundbank without error. If all goes well and no asserts get triggered, then play.

The code belows shows how to do this, with a loop to check to see if any of the channels are playing for that event.

//
//
#include "AudioManager.h"
#include "Soundbank.h"

//
//
int main()
{
Soundbank * testSoundbank;
SoundEvent testEvent;

//
//
AudioManager::Init();

//
//
testSoundbank = AudioManager::LoadSoundbankFromFile( "testSoundbank.fev" );
testSoundbank->GetEventByName( "test/someTestSound", testEvent );
testEvent.Play();

//
//
while( testEvent.IsPlaying() )
{
AudioManager::Update();
}

//
//
delete testSoundbank;

//
//
AudioManager::DeInit();

return 0;
}

Some improvements are required, but for now that’ll be my FMOD Ex code.

[Previous Page...]

Written by Kaluriel in: Athena, Code, Tutorials | Tags: , , ,

Pages: 1 2 3


No Comments »

RSS feed for comments on this post. TrackBack URL

Leave a comment

You must be logged in to post a comment.

Theme: TheBuckmaker.com Blog Themes | The best Webhosting Plans, Eigenes Internet Radio