Playing and recording time media

A player's start time is always zero and its duration is the duration of its sequence. The current position in the sequence is always greater than or equal to the player's start time and less than or equal to its duration.


When you call Play, the player plays the sequence from the current position and continues until Stop is called, the end of the sequence is reached, or an error occurs.

When you call Record, the new data overwrites any existing data, starting at the current position. Recording continues until Stop is called or an error occurs. Recording also stops if the TPlayer's clock is synchronized to an external clock and that clock stops or moves backward.

TIP A common recording error is to run out of space for the recorded data. You could implement a new player type that sets a maximum duration based on the current available space, but the space could still be filled by another process before all of the data is recorded.

You can set the current position with a player's Seek function:

      audioPlayer->Seek(TSeconds(3));
      audioPlayer->Play();
During playback or recording, a player's current position indicates what is being played at that instant.

You can use a player's GetDuration function to determine its duration. Not all players have a fixed duration; some sequences, such as interactive animations or audio loops can have different durations each time they are played. In such cases, the duration has the value TTime::kPositiveInfinity.


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker