Package-level declarations

Types

Link copied to clipboard
sealed class AudioFileFormat

Represents a supported audio container format for reading and writing.

Link copied to clipboard
class AudioFileReader(path: Path, fileSystem: FileSystem = SystemFileSystem)

Reads an audio file from disk and returns an AudioRecording.

Link copied to clipboard

Defines potential errors that can occur during the file reading process.

Link copied to clipboard

Defines potential errors that can occur during the file writing process.

Link copied to clipboard
class AudioFileWriter(fileFormat: AudioFileFormat, path: Path, fileSystem: FileSystem = SystemFileSystem)

Functions

Link copied to clipboard
suspend fun AudioFlow.collectAsBuffer(format: AudioFileFormat): Buffer

Collects this flow and returns an in-memory buffer containing the encoded file bytes for format (WAV, AIFF, or AU).

Link copied to clipboard
fun AudioRecording.Companion.fromBytes(bytes: ByteArray, fileFormat: AudioFileFormat = AudioFileFormat.Wav): AudioRecording

Decodes an audio file from raw bytes (e.g. Compose resources via Res.readBytes(), network responses, or any in-memory representation).

Link copied to clipboard
fun AudioRecording.Companion.fromFile(path: Path, fileSystem: FileSystem = SystemFileSystem): AudioRecording

Reads an audio file from the filesystem. The format is auto-detected from the file extension.

Link copied to clipboard
fun AudioRecording.Companion.fromSource(source: Source, fileFormat: AudioFileFormat = AudioFileFormat.Wav): AudioRecording

Decodes an audio file from a Source stream (e.g. Android ContentResolver, platform input streams, or any kotlinx.io.Source).

Link copied to clipboard
suspend fun AudioFlow.writeToFile(format: AudioFileFormat, path: Path)

Collects this flow and writes the PCM data to a file at path.

Link copied to clipboard
suspend fun AudioFlow.writeToSink(format: AudioFileFormat, sink: Sink)

Collects this flow and writes the PCM data to sink in the chosen file format (WAV, AIFF, or AU).