Microsoft DirectX 8.1 (Visual Basic)

DirectSoundSecondaryBuffer8.SetFrequency

The SetFrequency method sets the frequency at which the audio samples are played.

Syntax

object.SetFrequency(frequency As Long)

Parts

object

Resolves to a DirectSoundSecondaryBuffer8 object.

frequency

New frequency, in hertz, at which to play the audio samples. The value must be in the range DSBFREQUENCY_MIN (100) to DSBFREQUENCY_MAX (100,000).

If the value is DSBFREQUENCY_ORIGINAL, the frequency is reset to the default value in the buffer format. This format is specified in the DirectSound8.CreateSoundBuffer method.

Error Codes

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

DSERR_CONTROLUNAVAIL
DSERR_GENERIC
DSERR_INVALIDPARAM
DSERR_PRIOLEVELNEEDED

Remarks

Increasing or decreasing the frequency changes the perceived pitch of the audio data. This method does not affect the format of the buffer.

See Also