ISpeechBaseStream Seek Method (Microsoft Speech Platform)

Microsoft Speech Platform SDK 11

Microsoft Speech Platform

Object: ISpeechBaseStream

Seek Method

The Seek method returns the current read position of the stream in bytes.

The Seek method may also move the Seek pointer forward or backward in the stream. The parameter Position, specifies a number of bytes to move the Seek pointer forward in the stream; negative values specify moving the Seek pointer backward. The parameter Origin, specifies the point from which the forward or backward movement will begin. When the method has completed, it returns a Variant variable containing the new Seek pointer.


ISpeechBaseStream.Seek(
     Position As Variant,
     [Origin As SpeechStreamSeekPositionType = SSSPTRelativeToStart]
) As Variant

Parameters

Position
Specifies the number of bytes to move the Seek pointer forward in the stream. Negative values move the pointer backward.
Origin
[Optional] Specifies the Origin. Default value is SSSPTRelativeToStart.

Return Value

A Variant variable containing the new Seek pointer.


Remarks

The following are examples. This statement sets the Seek pointer 23,456 bytes past the start of the stream and returns a Variant containing the new Seek pointer:

	varCurPos = S.Seek(23456, SSSPTRelativeToStart)

This statement moves the Seek pointer forward 23,456 bytes and returns a Variant containing the new Seek pointer:

	varCurPos = S.Seek(23456, SSSPTRelativeToCurrentPosition)

This statement sets the Seek pointer to the end of the stream and returns a Variant containing the new Seek pointer, which in this case is equal to the size of the stream:

	varCurPos = S.Seek(0, SSSPTRelativeToEnd)

Example

Use of the Seek method is demonstrated in a code example at the end of the ISpeechBaseStream section.