The SetFrequency method sets the frequency at which the audio samples are played.
HRESULT SetFrequency( DWORD dwFrequency );
If the method succeeds, the return value is DS_OK. If the method fails, the return value may be one of the following error values:
Return code |
DSERR_CONTROLUNAVAIL |
DSERR_GENERIC |
DSERR_INVALIDPARAM |
DSERR_PRIOLEVELNEEDED |
Increasing or decreasing the frequency changes the perceived pitch of the audio data. This method does not affect the format of the buffer.
Before setting the frequency, you should ascertain whether the frequency is supported by checking the dwMinSecondarySampleRate and dwMaxSecondarySampleRate members of the DSCAPS structure for the device. Some operating systems do not support frequencies greater than 100,000 Hz.
This method is not valid for the primary buffer.
Header: Declared in Dsound.h.
Import Library: Use Dsound3d.dll.