Technical Integration Guide

This section provides the technical information you need to know in order to integrate Scaleform Video into your engine.

Scaleform Sound System Initialization

To initialize Scaleform sound system an instance of GFx::Audio class should be set on the GFx::Loader object. The purpose of this state is to provide the sound renderer object, SoundRenderer and synchronization parameters for playing SWF streaming sounds. The 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 FMOD cross-platform sound library and can be used on all supported platforms. To create an instance of this implementation Sound::SoundRendererFMOD::CreateSoundRenderer method should be called and then the created object should be initialized with FMOD::System object.

Example:

    // Initializing the sound renderer object
    FMOD::System* pFMOD = NULL;
    result = FMOD::System_Create(&pFMOD);
    if (result != FMOD_OK)
        exit(1);
    result = pFMOD->getVersion(&version);
    if (result != FMOD_OK || version < FMOD_VERSION)
        exit(1);
    result = pFMOD->init(64, FMOD_INIT_NORMAL, 0); 
    if (result != FMOD_OK)
        exit(1);
    Ptr<Sound::SoundRenderer> psoundRenderer = 
                *SoundRendererFMOD::CreateSoundRenderer();
    if (!psoundRenderer->Initialize(pFMOD))
        exit(1);

    // Setting an instance of GFx::Audio on the loader  
    Ptr<GFx::Audio> paudioState = *new GFx::Audio(psoundRenderer);
    loader.SetAudio (paudioState);