IAudioClockAdjustment::SetSampleRate method (audioclient.h)
The SetSampleRate method sets the sample rate of a stream.
Syntax
HRESULT SetSampleRate(
[in] float flSampleRate
);
Parameters
[in] flSampleRate
The new sample rate in frames per second.
Return value
If the method succeeds, it returns S_OK.
Return code | Description |
---|---|
|
The audio stream has not been successfully initialized. |
|
The sample rate is out of the range for the Audio Processing Object. |
Remarks
This method must not be called from a real-time processing thread.
The new sample rate will take effect after the current frame is done processing and will remain in effect until SetSampleRate is called again. The audio client must be initialized in shared-mode (AUDCLNT_SHAREMODE_SHARED), otherwise SetSampleRate fails.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 7 [desktop apps only] |
Minimum supported server | Windows Server 2008 R2 [desktop apps only] |
Target Platform | Windows |
Header | audioclient.h |
See also
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for