Microsoft DirectX 8.1 (Visual Basic)

DirectSoundPrimaryBuffer8.Stop

The Stop method causes the buffer to stop playing.

Syntax

object.Stop()

Parts

object

Resolves to a DirectSoundPrimaryBuffer8 object.

Error Codes

If the method fails, an error is raised and Err.Number may be set to one of the following error values.

DSERR_INVALIDPARAM
DSERR_PRIOLEVELNEEDED

Remarks

if an application has the DSSCL_WRITEPRIMARY level, this method stops the primary buffer and reset the play cursor to the beginning of the buffer. This is necessary because the primary buffers on most sound cards can play only from the beginning of the buffer.

However, if DirectSoundPrimaryBuffer8.Stop is called on a primary buffer and the application has a cooperative level other than DSSCL_WRITEPRIMARY, this method simply reverses the effects of DirectSoundPrimaryBuffer8.Play. It configures the primary buffer to stop if no secondary buffers are playing. If other buffers are playing in this or other applications, the primary buffer will not actually stop until they are stopped. This method is useful because playing the primary buffer consumes processing overhead even if the buffer is playing sound data with the amplitude of 0 decibels.