Description
The Channels
property of the SoundFile
class represents the number of audio channels present in the sound file. This property is an integer value that indicates how many separate audio channels are contained within the file. Common values include 1 for mono audio and 2 for stereo audio, but it can be higher for surround sound formats.
Usage
To access the number of channels in a SoundFile
instance, simply use the Channels
property. This property is read-only and provides information about the audio configuration of the sound file.
Example
// Example of accessing the Channels property
SoundFile soundFile = SoundFile.Load("path/to/soundfile.wav");
int numberOfChannels = soundFile.Channels;
// Output the number of channels
// Note: Replace with appropriate logging or UI display method
// e.g., Debug.Log(numberOfChannels);