AudioFormat
Represents audio format configuration for spatial audio processing.
This class encapsulates the complete specification for audio data format, including:
Data type of audio samples (e.g., 16-bit integer, 32-bit float).
Sampling rate (default: 48000 Hz).
Channel data layout (interleaved/non-interleaved).
Byte ordering (little-endian/big-endian).
Typical usage scenarios:
Audio capture configuration:
val format = AudioFormat( channelDataType =
AudioFormat.AudioChannelDataType.INT16, sampleRate = 44100 )Format validation and comparison:
if (inputFormat == expectedFormat) { // Handle compatible format }Constructors
Constructs audio format with detailed parameters.
Types
Properties
The audio channel data type, which can be either signed 8-bit, signed 16-bit, signed 24-bit, signed 32-bit, or 32-bit floating point.
Whether the channel data is interleaved, default is true.
Whether the channel data is little endian, default is true.
The sample rate of the channel data, default is 48000.