Kodio 0.1.5 Help

Audio Quality

Kodio provides predefined quality presets optimized for common recording scenarios. Each preset balances sample rate, channels, and bit depth for its intended use case.

Presets overview

Preset

Sample Rate

Channels

Bit Depth

Best For

🎤 Voice

16 kHz

Mono

16-bit

Speech, voice memos, transcription

🎵 Standard

44.1 kHz

Mono

16-bit

General audio, podcasts (default)

🎧 High

48 kHz

Stereo

16-bit

Music, professional content

🎚️ Lossless

96 kHz

Stereo

24-bit

Studio recording, archival

Usage

Pass a preset to any recording function:

// Voice memo val voiceNote = Kodio.record( duration = 30.seconds, quality = AudioQuality.Voice ) // Music recording val music = Kodio.record( duration = 3.minutes, quality = AudioQuality.High ) // Studio quality val master = Kodio.record( duration = 5.minutes, quality = AudioQuality.Lossless )

With a recorder:

val recorder = Kodio.recorder(quality = AudioQuality.Standard)

In Compose:

val recorderState = rememberRecorderState( quality = AudioQuality.Voice )

Choosing a preset

🎤 Voice

When to use: Voice memos, speech-to-text input, phone calls, podcasts with speech only.

Trade-off: Smallest files, optimized for speech frequencies (human voice range). Not suitable for music.

🎵 Standard

When to use: General-purpose recording, mixed content, compatibility with most playback systems.

Trade-off: CD-quality sample rate (44.1 kHz), good balance of quality and file size. Default if not specified.

🎧 High

When to use: Music recording, professional podcasts, content for distribution.

Trade-off: Stereo capture, higher sample rate. Larger files than Standard.

🎚️ Lossless

When to use: Studio recording, archival, post-processing workflows.

Trade-off: Maximum quality, largest files (~35 MB/minute). Overkill for most applications.

File sizes

Approximate sizes for uncompressed WAV files:

Preset

Per Minute

5 Minutes

30 Minutes

Voice

~2 MB

~10 MB

~60 MB

Standard

~5 MB

~25 MB

~150 MB

High

~11 MB

~55 MB

~330 MB

Lossless

~35 MB

~175 MB

~1 GB

Platform negotiation

Quality presets are forwarded to the platform's audio system as a request. If the exact format isn't supported, the platform gracefully falls back to the closest supported format:

Platform

Negotiation behavior

Android

Tries the requested format first, falls back to 48 kHz/mono/16-bit if AudioRecord rejects it

JVM (JavaSound)

Checks mixer support, falls back to the device's default format

macOS (CoreAudio)

Tries AudioQueue with the requested format, falls back through device default and platform default

iOS (AVAudioEngine)

Converts from hardware format; falls back to 48 kHz/mono/16-bit if the target format isn't representable in AVAudioFormat (e.g., 24-bit int)

Web (AudioWorklet)

Sample rate is a hint to getUserMedia; output is always mono 16-bit PCM due to worklet constraints

After recording starts, Recorder.format returns the actual negotiated format, which you can compare against the requested quality.format.

Custom formats

Need something different? Create a custom AudioFormat:

val customFormat = AudioFormat( sampleRate = 22050, channels = Channels.Mono, encoding = SampleEncoding.PcmInt(IntBitDepth.Sixteen) )

See Custom Formats for details.

Last modified: 04 April 2026