Microsoft DirectX 9.0 SDK Update (October 2004)

Buffer.Frequency Property

Language:

Note: This documentation is preliminary and is subject to change.

Retrieves or sets the frequency, in samples per second, at which the buffer is playing.

Definition

Visual Basic .NET Public Property Frequency As Integer
C# public int Frequency { get; set; }
Managed C++ public: __property int get_Frequency();
public: __property void set_Frequency(int);
JScript .NET public function get Frequency() : int
public function set Frequency(int);

Property Value

System.Int32 . Value that represents the frequency, in hertz (Hz), to set or retrieve. A value of Frequency.Original resets the frequency to the default value of the buffer format.

This property is read/write. 

Remarks

The frequency value for software buffers is in the range of Frequency.Min to Frequency.Max. Hardware buffers can return other values.

Increasing or decreasing the frequency changes the perceived pitch of the audio data. This property does not affect the format of the buffer.

Before setting the frequency, you should ascertain whether the frequency is supported by checking Caps.MinSecondarySampleRate and Caps.MaxSecondarySampleRate for the device. Some operating systems do not support frequencies greater than 100,000 Hz.

Exceptions
ArgumentException Leave Site An invalid parameter was passed to the called method.
ControlUnavailableException The buffer control (volume, pan, and so on) requested by the caller is not available. Controls must be specified when the buffer is created.
PriorityLevelNeededException A cooperative level of Priority or higher is required.

Applies To

SecondaryBuffer

© 2004 Microsoft Corporation. All rights reserved. Terms of use.

Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center