Description
The Rate
property of the SoundFile
class represents the sample rate of the sound file, measured in samples per second. This property is crucial for understanding the quality and playback speed of the audio file. A higher sample rate typically indicates better audio quality.
Usage
To access the Rate
property, you need to have an instance of the SoundFile
class. This property is read-only and provides the sample rate of the sound file.
Example
// Example of accessing the Rate property
SoundFile soundFile = SoundFile.Load("path/to/soundfile.wav");
int sampleRate = soundFile.Rate;
// Output the sample rate
// Note: Avoid using Console.WriteLine in s&box
// Instead, use the appropriate logging or UI display method
Log.Info($"Sample Rate: {sampleRate} samples per second");