Sets the frequency adjustment ratio of the voice.
HRESULT SetFrequencyRatio( float Ratio, UINT32 OperationSet X2DEFAULT );
Frequency adjustment ratio. This value must be between XAUDIO2_MIN_FREQ_RATIO and the MaxFrequencyRatio parameter specified when the voice was created (see IXAudio2::CreateSourceVoice). XAUDIO2_MIN_FREQ_RATIO currently is 0.0005, which allows pitch to be lowered by up to 11 octaves.
Returns S_OK if successful, an error code otherwise. See XAudio2 Error Codes for descriptions of error codes.
Frequency adjustment is expressed as source frequency / target frequency. Changing the frequency ratio changes the rate audio is played on the voice. A ratio greater than 1.0 will cause the audio to play faster and a ratio less than 1.0 will cause the audio to play slower. Additionally, the frequency ratio affects the pitch of audio on the voice. As an example, a value of 1.0 has no effect on the audio, whereas a value of 2.0 raises pitch by one octave and 0.5 lowers it by one octave.
If SetFrequencyRatio is called specifying a Ratio value outside the valid range, the method will set the frequency ratio to the nearest valid value. A warning also will be generated for debug builds.