To initialize the Scaleform sound system, an instance of the GFx::Audio state class should be set on the GFx::Loader object. The purpose of this state is to provide the sound renderer object, Sound::SoundRenderer and the synchronization parameters for playing Flash streaming sounds. The Sound::SoundRenderer class is an abstract C++ interface, which should be implemented in the game to produce the sound. Scaleform provides the default implementation, which is based on the FMOD cross-platform sound library and can be used on all supported platforms. The Scaleform SDK uses the FMOD Low Level API.
Example:
SoundRenderer* pSoundRenderer = GetSoundRenderer(); if (pSoundRenderer) { // Sound renderer and parameters for playing SWF streaming sounds // are provided to the loader by GFx::Audio. These parameters // control when and how the synchronization between SWF frames // and sound frames should be done. Ptr<GFx::Audio> pAudioState = *new Audio(pSoundRenderer); loader.SetAudio(pAudioState); pSoundRenderer->SetMasterVolume(SoundVolume); pSoundRenderer->Mute(IsMute); }
This sound system initialization is only required for embedded Flash audio support. If you are using the Sound Event Interface instead, with Wwise or your own sound engine, this step is not required.
Please refer to the source code of Scaleform Player and to the Flash sound example for details.