Video sound system interfaces

GFx::Video::VideoSoundSystem is an abstract interface providing sound support for video (GFx::Video::Video) playback; developers can substitute the video sound implementation by making their own version of this class. Before playing video, an instance of this class needs to be created and installed with Video::SetSoundSystem(). Typically, a platform-specific implementation can be used to avoid implementing this interface.

Following are the platform-specific sound system interfaces included in GFx::Video distribution:

In the current version of Scaleform, video sound support is decoupled from the embedded Flash sound playback, allowing video to be used without requiring the general sound engine. To make this work, video is supported by an independent GFx::Video::VideoSoundSystem class that is separate from Sound::SoundRenderer used in the rest of Scaleform. This means that to get video sound support, Video::VideoSoundSystem and Video::VideoSound class only need to be implemented, which are much simpler than Sound::SoundRenderer. Note that if you already have Sound::SoundRenderer implementation, you can use it directly to initialize Video::Video, as it provides a superset of functionality. In some cases, the two implementations can be mixed (helpful if a custom video sound class provides better streaming support than the general sound engine).

Example:

#include "Video/Video_VideoSoundSystemXA2.h"
pVideo->SetSoundSystem(Ptr<Video::VideoSoundSystem>(*new VideoSoundSystemXA2(0, 0)));

For video sound support, Video::VideoSoundSystem and Video::VideoSound need to be implemented. Typically there is only one instance of VideoSoundSystem installed during video initialization. VideoSoundSystem exposes a single method, Create, used to create VideoSound objects representing independent video sound streams. Scaleform will call this function every time a new video is opened (there can be multiple videos playing at the same time). After each VideoSound object is created, Scaleform will call its various functions to instruct it to Start and Stop audio output. The actual sound data for the stream is obtained through polling of the VideoSound::PCMStream passed to the given sound. Polling is typically done by a separate thread maintained by the VideoSoundSystem to service its active sounds.

Please note that the current implementation of VideoSoundSystemWwise based on Audio Input plug-in is available as part of Wwise SDK since v2009.2.1 build 3271. Audiokinetic provides the full source code and the Visual Studio solutions/projects of this plug-in can be found at SDK\samples\Plugins\AkAudioInput. Please refer to Wwise documentation for details. Scaleform Video distribution does not include any part of the Wwise SDK which should be installed separately.

Example:

#include " Video/Video_VideoSoundSystemWwise.h"

Ptr<Video::VideoSoundSystem> wwiseSound = Ptr<Video::VideoSoundSystem>(*new VideoSoundSystemWwise());
pVideo->SetSoundSystem(wwiseSound);
wwiseSound->Update();

Please refer to the source code of Scaleform Player and to the implementation of video sound system interfaces for details. Also, see the Getting Started with Video topic for information on playing videos.