Package-level declarations

Types

Link copied to clipboard
data class AudioAnalysisResult(val rmsLevel: Float, val rmsDb: Float, val peakLevel: Float, val peakDb: Float, val magnitudeSpectrum: FloatArray, val frequencyResolution: Float, val sampleRate: Int, val fftSize: Int)
Link copied to clipboard
class AudioAnalyzer(val fftSize: Int = 1024, val sampleRate: Int = 44100)
Link copied to clipboard
data class AudioDeviceInfo(val id: Int, val name: String, val isInput: Boolean, val isOutput: Boolean, val sampleRates: List<Int>, val channelCounts: List<Int>)

Describes an available audio device on the current platform.

Link copied to clipboard
actual class AudioEffect : AutoCloseable

Represents a single audio effect that can be applied to an audio stream.

actual class AudioEffect : <ERROR CLASS> ERROR CLASS: Symbol not found for AutoCloseable

Represents a single audio effect that can be applied to an audio stream.

expect class AudioEffect : AutoCloseable

Represents a single audio effect that can be applied to an audio stream.

actual class AudioEffect : AutoCloseable

Represents a single audio effect that can be applied to an audio stream.

actual class AudioEffect : AutoCloseable

Represents a single audio effect that can be applied to an audio stream.

actual class AudioEffect : AutoCloseable

Represents a single audio effect that can be applied to an audio stream.

Link copied to clipboard

An ordered chain of AudioEffect instances that are applied sequentially to an audio stream.

actual class AudioEffectChain : <ERROR CLASS> ERROR CLASS: Symbol not found for AutoCloseable

An ordered chain of AudioEffect instances that are applied sequentially to an audio stream.

An ordered chain of AudioEffect instances that are applied sequentially to an audio stream.

An ordered chain of AudioEffect instances that are applied sequentially to an audio stream.

An ordered chain of AudioEffect instances that are applied sequentially to an audio stream.

An ordered chain of AudioEffect instances that are applied sequentially to an audio stream.

Link copied to clipboard

Enumerates the types of audio effects available in the Klarinet SDK.

Link copied to clipboard
actual class AudioEngine : AutoCloseable

Entry point for the Klarinet audio library.

actual class AudioEngine : <ERROR CLASS> ERROR CLASS: Symbol not found for AutoCloseable

Entry point for the Klarinet audio library.

expect class AudioEngine : AutoCloseable

Entry point for the Klarinet audio library.

actual class AudioEngine : AutoCloseable

Entry point for the Klarinet audio library.

actual class AudioEngine : AutoCloseable

Entry point for the Klarinet audio library.

actual class AudioEngine : AutoCloseable

Entry point for the Klarinet audio library.

Link copied to clipboard
class AudioFileException(message: String, cause: Throwable? = null) : KlarinetException

Thrown when an audio file operation fails.

Link copied to clipboard

Supported audio file formats for reading and writing.

Link copied to clipboard
data class AudioFileInfo(val format: AudioFileFormat, val sampleRate: Int, val channelCount: Int, val durationMs: Long, val bitRate: Int, val tags: AudioFileTags)

Describes the format and properties of an audio file.

Link copied to clipboard
actual class AudioFileReader(filePath: String)

Reads and decodes audio data from a file on disk or a remote URL.

actual class AudioFileReader(filePath: String)

Reads and decodes audio data from a file on disk or a remote URL.

expect class AudioFileReader(filePath: String)

Reads and decodes audio data from a file on disk or a remote URL.

actual class AudioFileReader(filePath: String)

Reads and decodes audio data from a file on disk or a remote URL.

actual class AudioFileReader(filePath: String)

Reads and decodes audio data from a file on disk or a remote URL.

actual class AudioFileReader(filePath: String)

Reads and decodes audio data from a file on disk or a remote URL.

actual class AudioFileReader(filePath: String)

watchOS implementation of AudioFileReader.

actual class AudioFileReader(filePath: String)

watchOS implementation of AudioFileReader.

Link copied to clipboard
data class AudioFileTags(val title: String? = null, val artist: String? = null, val album: String? = null, val trackNumber: Int? = null, val genre: String? = null, val year: Int? = null, val albumArt: ByteArray? = null)

Metadata tags associated with an audio file.

Link copied to clipboard
actual class AudioFileWriter(filePath: String, format: AudioFileFormat, sampleRate: Int, channelCount: Int, tags: AudioFileTags?)

Encodes and writes audio data to a file on disk.

actual class AudioFileWriter(filePath: String, format: AudioFileFormat, sampleRate: Int, channelCount: Int, tags: AudioFileTags?)

Encodes and writes audio data to a file on disk.

expect class AudioFileWriter(filePath: String, format: AudioFileFormat, sampleRate: Int, channelCount: Int, tags: AudioFileTags? = null)

Encodes and writes audio data to a file on disk.

actual class AudioFileWriter(filePath: String, format: AudioFileFormat, sampleRate: Int, channelCount: Int, tags: AudioFileTags?)

Encodes and writes audio data to a file on disk.

actual class AudioFileWriter(filePath: String, format: AudioFileFormat, sampleRate: Int, channelCount: Int, tags: AudioFileTags?)

Encodes and writes audio data to a file on disk.

actual class AudioFileWriter(filePath: String, format: AudioFileFormat, sampleRate: Int, channelCount: Int, tags: AudioFileTags?)

Encodes and writes audio data to a file on disk.

actual class AudioFileWriter(filePath: String, format: AudioFileFormat, sampleRate: Int, channelCount: Int, tags: AudioFileTags?)

Encodes and writes audio data to a file on disk.

actual class AudioFileWriter(filePath: String, format: AudioFileFormat, sampleRate: Int, channelCount: Int, tags: AudioFileTags?)

Encodes and writes audio data to a file on disk.

Link copied to clipboard

Supported audio sample formats.

Link copied to clipboard
data class AudioInterruptionInfo(val type: AudioInterruptionType, val shouldResume: Boolean)

A call, Siri, another app, or audio-focus loss interrupted playback.

Link copied to clipboard

Whether an audio interruption is starting or finishing.

Link copied to clipboard
object AudioMath
Link copied to clipboard
data class AudioRouteChangeInfo(val reason: String, val previousRoute: String)

Describes an audio route change event, such as headphones being plugged in or disconnected, or a Bluetooth device connecting.

Link copied to clipboard
data class AudioScene(val id: String, val layers: List<SceneLayer> = emptyList())

A portable mix description: named layers, levels, and effect parameters.

Link copied to clipboard

JSON codec for AudioScene. Hosts can ship .json files as their own presets.

Link copied to clipboard

Loads AudioScenes onto live streams and crossfades between them.

Link copied to clipboard

Defines the audio session category, which determines how the app interacts with the system audio and other apps.

Defines the audio session category, which determines how the app interacts with the system audio and other apps.

Defines the audio session category, which determines how the app interacts with the system audio and other apps.

Defines the audio session category, which determines how the app interacts with the system audio and other apps.

Defines the audio session category, which determines how the app interacts with the system audio and other apps.

Defines the audio session category, which determines how the app interacts with the system audio and other apps.

Link copied to clipboard
class AudioSessionException(message: String, cause: Throwable? = null) : KlarinetException

Thrown when an audio session operation fails.

Link copied to clipboard
actual class AudioSessionManager

Manages the platform audio session, controlling how the app interacts with the system audio infrastructure and other audio apps.

actual class AudioSessionManager

Manages the platform audio session, controlling how the app interacts with the system audio infrastructure and other audio apps.

expect class AudioSessionManager

Manages the platform audio session, controlling how the app interacts with the system audio infrastructure and other audio apps.

actual class AudioSessionManager

Manages the platform audio session, controlling how the app interacts with the system audio infrastructure and other audio apps.

actual class AudioSessionManager

Manages the platform audio session, controlling how the app interacts with the system audio infrastructure and other audio apps.

actual class AudioSessionManager

Manages the platform audio session, controlling how the app interacts with the system audio infrastructure and other audio apps.

Link copied to clipboard

Defines the audio session mode, which further specializes the behavior of the selected AudioSessionCategory.

Defines the audio session mode, which further specializes the behavior of the selected AudioSessionCategory.

Defines the audio session mode, which further specializes the behavior of the selected AudioSessionCategory.

Defines the audio session mode, which further specializes the behavior of the selected AudioSessionCategory.

Defines the audio session mode, which further specializes the behavior of the selected AudioSessionCategory.

Defines the audio session mode, which further specializes the behavior of the selected AudioSessionCategory.

Link copied to clipboard
actual class AudioStream : AutoCloseable

A platform audio stream for playback or recording.

actual class AudioStream : <ERROR CLASS> ERROR CLASS: Symbol not found for AutoCloseable

A platform audio stream for playback or recording.

expect class AudioStream : AutoCloseable

A platform audio stream for playback or recording.

actual class AudioStream : AutoCloseable

A platform audio stream for playback or recording.

actual class AudioStream : AutoCloseable

A platform audio stream for playback or recording.

actual class AudioStream : AutoCloseable

A platform audio stream for playback or recording.

Link copied to clipboard

Callback interface for audio stream events.

Link copied to clipboard
class AudioStreamCallbackImpl(onAudioReadyBlock: (buffer: FloatArray, numFrames: Int) -> Int) : AudioStreamCallback

Concrete implementation of AudioStreamCallback that delegates to a lambda.

class AudioStreamCallbackImpl(onAudioReadyBlock: (buffer: FloatArray, numFrames: Int) -> Int) : AudioStreamCallback
class AudioStreamCallbackImpl(onAudioReadyBlock: (buffer: FloatArray, numFrames: Int) -> Int) : AudioStreamCallback

Concrete implementation of AudioStreamCallback that delegates to a lambda.

class AudioStreamCallbackImpl(onAudioReadyBlock: (buffer: FloatArray, numFrames: Int) -> Int) : AudioStreamCallback

Concrete implementation of AudioStreamCallback that delegates to a lambda.

Link copied to clipboard
data class AudioStreamConfig(val sampleRate: Int = 48000, val channelCount: Int = 1, val audioFormat: AudioFormat = AudioFormat.PCM_FLOAT, val bufferCapacityInFrames: Int = 0, val performanceMode: PerformanceMode = PerformanceMode.LOW_LATENCY, val sharingMode: SharingMode = SharingMode.SHARED, val direction: StreamDirection = StreamDirection.OUTPUT, val deviceId: Int? = null)

Configuration for creating an AudioStream via AudioEngine.openStream.

Link copied to clipboard
object BPFParams

Parameter IDs for the AudioEffectType.BAND_PASS_FILTER effect.

Link copied to clipboard

Parameter IDs for the AudioEffectType.CHORUS effect.

Link copied to clipboard
class ChunkedAudioFileWriter(outputDirectory: String, filePrefix: String, format: AudioFileFormat, sampleRate: Int, channelCount: Int, maxChunkDurationMs: Long = 30 * 60 * 1000L, tags: AudioFileTags? = null)
Link copied to clipboard

Parameter IDs for the AudioEffectType.COMPRESSOR effect.

Link copied to clipboard

Parameter IDs for the AudioEffectType.DELAY effect.

Link copied to clipboard

Thrown when a requested audio device could not be found.

Link copied to clipboard
object EQParams

Parameter IDs for the AudioEffectType.PARAMETRIC_EQ effect.

Link copied to clipboard
class Fft(val size: Int)
Link copied to clipboard

Parameter IDs for the AudioEffectType.FLANGER effect.

Link copied to clipboard
object GainParams

Parameter IDs for the AudioEffectType.GAIN effect.

Link copied to clipboard
object HPFParams

Parameter IDs for the AudioEffectType.HIGH_PASS_FILTER effect.

Link copied to clipboard
open class KlarinetException(message: String, cause: Throwable? = null) : Exception

Base exception for all errors originating from the Klarinet audio SDK.

Link copied to clipboard
data class LatencyInfo(val inputLatencyMs: Double, val outputLatencyMs: Double)

Latency measurements for an AudioStream, reported in milliseconds.

Link copied to clipboard

Parameter IDs for the AudioEffectType.LIMITER effect.

Link copied to clipboard
object LPFParams

Parameter IDs for the AudioEffectType.LOW_PASS_FILTER effect.

Link copied to clipboard

Parameter IDs for the AudioEffectType.MUTE_SOLO effect.

Link copied to clipboard

Parameter IDs for the AudioEffectType.NOISE_GATE effect.

Link copied to clipboard
object PanParams

Parameter IDs for the AudioEffectType.PAN effect.

Link copied to clipboard
data class ParameterChange(val effect: AudioEffect, val paramId: Int, val value: Float)

Describes a single parameter change to be applied to an AudioEffect.

Link copied to clipboard

Hint to the platform about the desired trade-off between audio latency and power consumption.

Link copied to clipboard

Thrown when a required audio permission has not been granted.

Link copied to clipboard

Parameter IDs for the AudioEffectType.PHASER effect.

Link copied to clipboard

Thrown when an operation is attempted on an engine, stream, effect, or chain that has already been AutoCloseable.closed or released.

Link copied to clipboard

Parameter IDs for the AudioEffectType.REVERB effect.

Link copied to clipboard
data class SceneEffect(val type: AudioEffectType, val params: Map<Int, Float> = emptyMap())

One effect on a SceneLayer, excluding the mix Gain which is SceneLayer.gainDb.

Link copied to clipboard
class SceneFormatException(message: String, cause: Throwable? = null) : KlarinetException

Thrown when AudioSceneJson.decode cannot read a scene document.

Link copied to clipboard
data class SceneLayer(val id: String, val gainDb: Float = 0.0f, val effects: List<SceneEffect> = emptyList())

One layer in an AudioScene.

Link copied to clipboard

Controls whether an audio stream shares the audio device with other applications or requests exclusive access.

Link copied to clipboard

Schedules a fade-out and then stops an AudioStream.

Link copied to clipboard
Link copied to clipboard
class StreamCreationException(message: String, cause: Throwable? = null) : KlarinetException

Thrown when an audio stream or effect could not be created.

Link copied to clipboard

Direction of an audio stream, indicating whether it captures or plays audio.

Link copied to clipboard

Thrown when an operation on an active audio stream fails.

Link copied to clipboard

Lifecycle state of an AudioStream.

Link copied to clipboard

Parameter IDs for the AudioEffectType.TREMOLO effect.

Link copied to clipboard

Thrown when the requested audio format is not supported by the platform or device.

Functions

Link copied to clipboard

Encodes a previously stored file as a 16-bit PCM WAV.

Link copied to clipboard

Decodes bytes with Web Audio decodeAudioData and stores the PCM so AudioFileReader can open path synchronously.

Link copied to clipboard

Fetches url, decodes it with Web Audio decodeAudioData, and stores the PCM so AudioFileReader can open the same URL synchronously.

Link copied to clipboard
fun AudioEngine.playFile(filePath: String, config: AudioStreamConfig = AudioStreamConfig()): AudioStream

Play an audio file through the engine.

Link copied to clipboard
fun putAudioFile(path: String, samples: FloatArray, sampleRate: Int, channelCount: Int, format: AudioFileFormat = AudioFileFormat.WAV, tags: AudioFileTags = AudioFileTags(), durationMs: Long = if (sampleRate > 0) { (samples.size / channelCount.coerceAtLeast(1)) * 1000L / sampleRate } else { 0L })

Stores decoded PCM so AudioFileReader can open path synchronously.

Link copied to clipboard
fun putWavBytes(path: String, bytes: ByteArray, tags: AudioFileTags = AudioFileTags())

Parses a WAV byte array (16-bit PCM or 32-bit float) into the in-memory store.

Link copied to clipboard
fun AudioEngine.recordToFile(filePath: String, format: AudioFileFormat = AudioFileFormat.WAV, config: AudioStreamConfig = AudioStreamConfig(direction = StreamDirection.INPUT)): AudioStream

Record audio from the microphone to a file.