Kodio 0.1.1 Help

Audio Format

The AudioFormat class defines technical specifications for audio data.

AudioFormat

data class AudioFormat( val sampleRate: Int, // Hz val channels: Channels, // Mono or Stereo val encoding: SampleEncoding )

Creating custom formats

val format = AudioFormat( sampleRate = 48000, channels = Channels.Stereo, encoding = SampleEncoding.PcmInt(IntBitDepth.Sixteen) )

Channels

Mono

Single channel (1)

Stereo

Left and right (2)

Bit depths

Eight

8-bit (48 dB range)

Sixteen

16-bit (96 dB range) - standard

TwentyFour

24-bit (144 dB range) - professional

ThirtyTwo

32-bit (192 dB range)

Computed properties

bytesPerSample

Bytes for one sample

bytesPerFrame

Bytes for one frame (all channels)

Last modified: 13 January 2026