Buffer.SetCurrentPosition(Int32) Method (Microsoft.DirectX.DirectSound)

Sets the position of the play cursor, which is the point at which the next byte of data is read from the buffer.

Definition

Visual Basic Public Sub SetCurrentPosition( _
    ByVal newPosition As Integer _
)
C# public void SetCurrentPosition(
    int newPosition
);
C++ public:
void SetCurrentPosition(
    int newPosition
);
JScript public function SetCurrentPosition(
    newPosition : int
);

Parameters

newPosition System.Int32
An integer that represents the offset of the play cursor, in bytes, from the beginning of the buffer.

Remarks

This method cannot be called on the primary sound buffer.

If the buffer is playing, the cursor immediately moves to the new position and play continues from that point. If it is not playing, playback will begin from the new position the next time the Buffer.Play method is called.

Exceptions

ArgumentExceptionLeave Site

An invalid parameter was passed to the called method.

InvalidCallException

The method call is invalid for the current state of this object.

PriorityLevelNeededException

A cooperative level of Priority or higher is required.

Applies To

SecondaryBuffer