Package-level declarations

Types

Link copied to clipboard
class AnalyzingCallback(analyzer: AudioAnalyzer, delegate: AudioStreamCallback? = null, scope: CoroutineScope) : AudioStreamCallback

Functions

Link copied to clipboard
fun AudioFileReader.asFlow(chunkSize: Int = 4096, dispatcher: CoroutineDispatcher = defaultIoDispatcher): Flow<FloatArray>

Streams decoded audio data as a Flow of chunks.

Link copied to clipboard
suspend fun AudioStream.awaitState(target: StreamState)

Suspends until the stream reaches the target StreamState.

Suspends until the timer reaches target.

Link copied to clipboard

Audio interruptions as a cold Flow.

Link copied to clipboard
fun AudioStream.levelFlow(intervalMs: Long = 50): Flow<Float>

Emits the peak audio level at a regular polling interval.

Link copied to clipboard
suspend fun AudioFileReader.readAllSuspend(dispatcher: CoroutineDispatcher = defaultIoDispatcher): FloatArray

Reads and decodes all remaining audio frames on the IO dispatcher.

Link copied to clipboard
suspend fun AudioFileReader.readFramesSuspend(maxFrames: Int, dispatcher: CoroutineDispatcher = defaultIoDispatcher): FloatArray

Reads up to maxFrames audio frames on the IO dispatcher.

Link copied to clipboard
fun SleepTimer.remainingMsFlow(intervalMs: Long = 50): Flow<Long>

Emits SleepTimer.remainingMs on a regular interval.

Link copied to clipboard

Audio route changes as a cold Flow.

Link copied to clipboard
fun AudioStream.stateFlow(intervalMs: Long = 50): Flow<StreamState>

Observes the stream's StreamState as a cold Flow.

fun SleepTimer.stateFlow(intervalMs: Long = 50): Flow<SleepTimerState>

Observes the timer's SleepTimerState as a cold Flow.

Link copied to clipboard
suspend fun AudioFileWriter.writeFramesSuspend(data: FloatArray, numFrames: Int, dispatcher: CoroutineDispatcher = defaultIoDispatcher)

Writes audio frames on the IO dispatcher.