BB FlashBack SDK: In-movie Presentation Classes |
How The Sound Classes Work
The FlashBack SDK can record a number of tracks of sound in a movie. Each track contains a number of non-overlapping sound 'clips'. Each clip can be a sound file or recording.
FBSounds class is the container for all sound tracks.
FBSoundProperties class corresponds to a sound track. There can be a number of them playing simultaneously in a movie. Each track can contain a number of sound clips.
FBSoundClip class corresponds to a single sound - a file or a recording.
Adding a sound file to a movie
Create
a new FBSoundProperties
object, setting its volume, start frame, and the name of the sound file
it is derived from.
This will create an FBSoundProperties
object containing one FBSoundClip
- the sound file.
Use FBEditor::InsertSound to add the FBSoundProperties object to the movie.
How to get access to the tracks and sound clips in a movie:
Use FBEditor::GetSounds to get an FBSounds object that contains all the sound tracks in a movie.
Use
FBSounds::GetProperties and FBSounds::GetPropertiesByID
to get the FBSoundProperties
objects.
Note: the FBSoundProperties
object should be created by your code and the pointer passed into GetProperties.
Use
FBSoundProperties::GetSoundClipProperties
to get access to the FBSoundClip
objects contained within the FBSoundProperties
object.
Note: the FBSoundClip
object should be created by your code and the pointer passed into GetSoundClipProperties.
Properties of the sound clip can be changed and written back to the movie with FBSoundProperties::SetSoundClipProperties.
How edit operations affect sounds
When your
code adds a sound to a movie, via FBEditor::InsertSound,
this creates a single 'track' - an FBSoundProperties
object - containing one FBSoundClip
object.
This single clip can be split into multiple clips by calls to FBMovie::InsertFrames,
with the UpdateSounds parameter set to true. If you insert frames into
a frame where the clip is playing, and set UpdateSounds to true, silence
will be inserted into the clip, effectively breaking it into two clips
at the insertion point, separated by silence.