Buffer.Frequency Property (Microsoft.DirectX.DirectSound)

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

Definition

Visual Basic Public Property Frequency As Integer
C# public int Frequency { get; set; }
C++ public:
property int Frequency {
        int get();
        void set(int value);
}
JScript 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

ArgumentExceptionLeave 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