TeeAudioProcessor.WavFileAudioBufferSink


class TeeAudioProcessor.WavFileAudioBufferSink : TeeAudioProcessor.AudioBufferSink


A sink for audio buffers that writes output audio as .wav files with a given path prefix. When new audio data is handled after flushing the audio processor, a counter is incremented and its value is appended to the output file name.

Note: if writing to external storage it's necessary to grant the WRITE_EXTERNAL_STORAGE permission.

Summary

Public constructors

WavFileAudioBufferSink(outputFileNamePrefix: String!)

Creates a new audio buffer sink that writes to .wav files with the given prefix.

Public functions

Unit
flush(sampleRateHz: Int, channelCount: Int, @C.PcmEncoding encoding: Int)

Called when the audio processor is flushed with a format of subsequent input.

Unit

Called when data is written to the audio processor.

Public constructors

WavFileAudioBufferSink

WavFileAudioBufferSink(outputFileNamePrefix: String!)

Creates a new audio buffer sink that writes to .wav files with the given prefix.

Parameters
outputFileNamePrefix: String!

The prefix for output files.

Public functions

flush

fun flush(sampleRateHz: Int, channelCount: Int, @C.PcmEncoding encoding: Int): Unit

Called when the audio processor is flushed with a format of subsequent input.

handleBuffer

fun handleBuffer(buffer: ByteBuffer!): Unit

Called when data is written to the audio processor.

Parameters
buffer: ByteBuffer!

A read-only buffer containing input which the audio processor will handle.