Migration
Guide for upgrading between Kodio versions.
0.2.x to 0.3.0
No source changes are required; these are behavior changes to be aware of.
Playback
All built-in sessions use buffered transport playback with real seeking (
seekToreturnsSeekResult.Applied).BaseAudioPlaybackSession.playBlockingis deprecated for custom sessions.State.Finishedis reported once the device has played the audio, not when the last bytes were handed to it.awaitComplete()followed byrelease()no longer cuts off the end of a clip.Calling
play()again afterFinishedreplays from the start (unless you seeked since).A failing source (e.g. a corrupt file) ends in
State.Errorafter playing what was decoded, instead of stayingPlaying.Player.release()/AudioPlaybackSession.release()now also cancel the session's background work. Do not reuse a released player.
Recording
AudioRecording.durationis computed from the PCM when no duration was supplied, so recordings fromKodio.record/Recorderare no longernull.Web: the browser's voice processing (echo cancellation, noise suppression, auto gain) stays on by default. Pass
inputProcessing = InputProcessing.RawtoKodio.recorder/Kodio.record/rememberRecorderStatefor the unprocessed signal.Recorder.getRecording()waits for audio a platform delivers just afterstop()(newAudioRecordingSession.awaitCaptureComplete()), so web recordings keep their last ~40 ms.
Errors
Kodio helpers (record, play, recorder, player) rethrow CancellationException instead of wrapping it in AudioError.
0.1.x to 0.2.0
Compose API consolidation
RecordAudioState/rememberRecordAudioState() and PlayAudioState/rememberPlayAudioState() were removed, along with KodioTheme, KodioComponents, AudioGraph, KodioIcons, and KodioColors. Use RecorderState/PlayerState and AudioWaveform instead.
Material 3 components
RecordAudioButton, PlayAudioButton, ErrorDialog, and AudioPermissionButton now take RecorderState or PlayerState instead of the removed Compose state types.
Transcription configuration
TranscriptionConfig now has only the language field. Removed fields: model, interimResults, punctuation, profanityFilter, diarization, and keywords. Removed presets: VoiceCommand and Meeting. Removed type: TranscriptionException.
Errors from transcription now surface as TranscriptionResult.Error in the result flow, not as thrown TranscriptionException.
JVM native path on macOS
The macOS JVM native CoreAudio path now requires JDK 22 or later (Panama FFI finalized in JDK 22). On JDK 24 and later, pass --enable-native-access=ALL-UNNAMED to silence restricted native access warnings.
See Platform Setup for JVM flags and Gradle configuration.
AudioRecording equality
AudioRecording.equals() now compares audio content (byte-for-byte), not just format and size. Two recordings with the same format and size but different samples are no longer equal. hashCode() remains coarse (format and size only), so do not use AudioRecording as a hash map key when content equality matters.
Recording start failures
In 0.2.0, Recorder.start() throws when the underlying recording session fails to start (for example a hardware error or an unsupported format that cannot be negotiated). Previously, some failures left the session in an error state without propagating to the caller. If you call Recorder.start() directly, wrap it in try/catch. In Compose, RecorderState.start() catches these exceptions and surfaces them via RecorderState.error.
0.0.5 to 0.0.6
Error types are now classes for proper stack traces:
Session API to high-level API
Compose migration
Accessing sessions
The session API is still available for advanced use:
File I/O (0.2.x)
Container loaders no longer default to WAV. Format is detected from magic bytes, then extension. Unresolved formats throw AudioFileReadError.UnsupportedFormat.
Raw PCM construction was renamed:
Container load:
MP3 decode is supported. MP3 encode throws AudioFileWriteError.UnsupportedFormat. See File I/O and Metadata.