writeFramesSuspend

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

Writes audio frames on the IO dispatcher.

Suspending wrapper around AudioFileWriter.writeFrames. Cancellation is cooperative at the dispatcher boundary; once the native write starts it runs to completion.

Parameters

data

Interleaved PCM float samples in [-1.0, 1.0].

numFrames

Number of frames to write.

dispatcher

Dispatcher for the blocking write. Defaults to the platform IO dispatcher (kotlinx.coroutines.Dispatchers.IO except JS, which uses Dispatchers.Default).

See also

AudioFileReader.readAllSuspend