int SampleRate { get; set; }

robot_2Generated
code_blocksInput

Description

The SampleRate property of the SoundHandle class specifies the number of audio samples per second. This property is crucial for determining the quality and fidelity of the sound being played. A higher sample rate typically results in better sound quality, as it captures more detail from the original audio source.

Usage

Use the SampleRate property to get or set the sample rate of a sound. This can be useful when you need to adjust the sound quality or when working with different audio formats that require specific sample rates.

Example

// Example of accessing the SampleRate property
SoundHandle soundHandle = new SoundHandle();
int currentSampleRate = soundHandle.SampleRate;

// Set a new sample rate
soundHandle.SampleRate = 44100; // Set to 44.1 kHz, a common sample rate for audio files