Scaleform::GFx::Video::VideoSoundSystem
class VideoSoundSystem : public RefCountBaseNTS<VideoSoundSystem,Stat_Video_Mem>;
VideoSound is an abstract interface providing sound support for Video playback; developers can substitute 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 sample implementation such as VideoSoundSystemDX8 or VideoSoundSystemWii can be used to avoid implementing this interface.
In the current version of GFx, 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 VideoSoundSystem class that is separate from SoundRenderer used in the rest of GFx. This means that to get video sound support you only need to implement VideoSoundSystem and VideoSound classes, which are much simpler than SoundRenderer. Note that if you already have SoundRenderer implementation, you can use it directly to initialize Video, as it provides a superset of functionality. In some cases you can also mix two implementations (helpful if a custom video sound class provides better streaming support than the general sound engine).
To have video sound support you need to implement two classes: VideoSoundSystem and VideoSound. 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. GFx 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, GFx 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.
Method |
Description |
Creates a VideoSound stream object for a particular video instance. | |
Gets a pointer to the memory heap used for video sound system allocations. | |
Updates the video sound systems. | |
Initializes VideoSoundSystem. |
Video_Video.h