Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

IAudioClockAdjustment::SetSampleRate method

The SetSampleRate method sets the sample rate of a stream.

Syntax


HRESULT SetSampleRate(
  [infloat flSampleRate
);

Parameters

flSampleRate [in]

The new sample rate in frames per second.

Return value

If the method succeeds, it returns S_OK.

Return codeDescription
AUDCLNT_E_NOT_INITIALIZED

The audio stream has not been successfully initialized.

E_INVALIDARG

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

Minimum supported client

Windows 7 [desktop apps only]

Minimum supported server

Windows Server 2008 R2 [desktop apps only]

Header

Audioclient.h

See also

IAudioClockAdjustment
AUDCLNT_STREAMFLAGS_XXX Constants

 

 

Show:
© 2017 Microsoft