Platform SDK: DirectX |
The IDirectSoundBuffer::SetFrequency method sets the frequency at which the audio samples are played.
HRESULT SetFrequency( DWORD dwFrequency );
If the value is DSBFREQUENCY_ORIGINAL, the frequency is reset to the default value in the current buffer format. This format is specified in the IDirectSound::CreateSoundBuffer method.
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:
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.
This method is not valid for primary sound buffers.
Windows NT/2000: Requires Windows NT 4.0 SP3 or later.
Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
Header: Declared in dsound.h.
Import Library: Use dsound.lib.
IDirectSoundBuffer, IDirectSound::CreateSoundBuffer, IDirectSoundBuffer::GetFrequency, IDirectSoundBuffer::Play, IDirectSoundBuffer::SetFormat