WaveformAudioBufferSink


@UnstableApi
class WaveformAudioBufferSink : TeeAudioProcessor.AudioBufferSink


A sink for audio buffers that produces waveform bars.

Summary

Nested types

Listener for the audio waveform generation.

Aggregates a group of audio samples.

Public constructors

WaveformAudioBufferSink(
    barsPerSecond: Int,
    outputChannelCount: Int,
    listener: WaveformAudioBufferSink.Listener!
)

Creates a new instance.

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

WaveformAudioBufferSink

WaveformAudioBufferSink(
    barsPerSecond: Int,
    outputChannelCount: Int,
    listener: WaveformAudioBufferSink.Listener!
)

Creates a new instance.

Parameters
barsPerSecond: Int

The number of bars that should be generated per each second of audio.

outputChannelCount: Int

The number of channels that the output waveform should contain. If this is different than the number of input channels, the audio will be mixed using the default mixing matrix.

listener: WaveformAudioBufferSink.Listener!

The listener to be notified when a new waveform bar has been generated.

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.