VideoSound

VideoSound
Scaleform::GFx::Video::VideoSound
Declaration
class VideoSound : public RefCountBaseNTS<VideoSound,Stat_Video_Mem>;
Description

VideoSound object represents a stream of audio data for a single video file playing within GFx. VideoSound objects are created by the VideoSoundSystem::Create function; they are further initialized by CreateOutput. After creation, GFx calls Start, Stop, Pause and other functions of the sound object to tell it when to start and stop streaming data. 

VideoSound receives its PCM data by polling it from the video player through the PCMStream interface passed to the Start function. PCM data can be requested in either 16-bit integer or 32-bit floating point format; users specify the desired format by implementing the GetPCMFormat function. The actual polling process typically takes place on a separate thread created by the sound or VideoSoundSystem

The following is a detailed sequence of events that takes place with VideoSound object:

  1. VideoSound is created by VideoSoundSystem::Create.
  2. CreateOutput is called to initialize the sound stream, specifying the number of channels and the sample rate.
  3. Start is called to begin audio streaming. At this point, VideoSound implementaion should begin polling PCMStream for audio data.
  4. Pause is called to temporarily stop and resume playback without losing position within the audio stream.
  5. Stop completes sound playback; after this function is called PCMStream should no longer be polled.
  6. DestroyOutput shuts down the sound channel.
  7. VideoSound destructor is called at some point later on once its reference count goes down to zero.

Throughout its lifetime, VideoSound is responsible for maintaining its Status state and reporting it properly from the GetStatus() function. The status starts out in Sound_Stopped state and transitions to Sound_Playing when Start is called. The other status states include Sound_Paused and Sound_Error.

Classes
Class 
Description 
An abstract interface used by VideoSound implementation to retrieve sound data from the video player. 
Enumerations
Enumeration 
Description 
Specifies the format of uncompressed PCM sound data supported by this VideoSound implementation. A value of this type is returned by GetPCMFormat
Indicates the current status of the VideoSound object. Implementation should properly transition the status within Start, Stop and Pause calls. 
Methods
Method 
Description 
Initializes sound output to the specified number of channels and sample rate. 
Shuts down sound output. Internal hardware sound buffers can be destroyed during this call. 
Returns the format of the PCM data expected by VideoSound implementation. 
Obtains the instance of the sound channel for setting the volume of the sound. 
Returns the current playback status. 
Returns the time of user audio playback from the stream, in user specified units. 
Pauses or resumes the sound streaming, temporarily halting playback and PCM polling. 
Sets the sound spatial information such as position, orientation and velocity. 
Tells VideoSound to begin sound output by polling PCM data from the PCM stream interface. 
Stop 
Tells video sound to stop sound object. PCMStream should not be polled for data after this call. 
File

Video_Video.h