TACSFileIn Methods


procedure Jump(Offs : Integer);

This method allows you to change playing position. Jump may be called either before starting playback (in this case the playback will be started from the position specified) or during the playback. Offs is the number of the file contents percents to be skipped. Positive value skips forward, negative value skips backward. For example call WaveIn1.Jump(-100) ; sets playing position at the beginning of the file.


function Seek(SampleNum : Integer) : Boolean;

If the audio file/stream is seekable (most are) Seek performs serach of the audio sample, specified by its number (passed in the SampleNum parameter) and sets playing position to that sample. The samples are counted starting from 0. The total number of samples may be read from TotalSamples property.

The Seek function can perform its operation only when the file/stream is playing. If you want to set the playing position before the file input component starts playback, use StartSample property instead. Seek returns False if it fails to perform the search.


function SetEndTime(Minutes, Seconds : Integer) : Boolean;

This function is a wrapper around EndSample property, provided for convenience. It allows you to set playback stop position not in samples but in minutes and seconds. Note that calls

SetEndTime(1, 30);

and
SetEndTime(0, 90);

are both allowed. This function may be safely called both at playback time and before the playback is started.


function SetStartTime(Minutes, Seconds : Integer) : Boolean;

This function is a wrapper around StartSample property, provided for convenience. It allows you to set playback start position not in samples but in minutes and seconds. Note that calls

SetStartTime(1, 30);

and
SetStartTime(0, 90);

are both allowed.

You can mix usage of this function and EndSample property. For example, if you want to play an audio fragment from TWaveIn component starting at one minute and ending at the end of file, you may use the following:

WaveIn1.SetStartTime(1, 0);
WaveIn1.EndSample := -1;

SetStartTime function may be safely called both at playback time and before the playback is started.


TACSFileIn ACS Classes Home


Copyright © 2002, 2003 Andrei Borovsky. All rights reserved.