WaveformAudioBufferSink
@UnstableApi
public class WaveformAudioBufferSink implements TeeAudioProcessor.AudioBufferSink
A sink for audio buffers that produces waveform bars.
Summary
Nested types |
|---|
public interface WaveformAudioBufferSink.ListenerListener for the audio waveform generation. |
public class WaveformAudioBufferSink.WaveformBarAggregates a group of audio samples. |
Public constructors |
|---|
WaveformAudioBufferSink(Creates a new instance. |
Public methods |
|
|---|---|
void |
flush(int sampleRateHz, int channelCount, @C.PcmEncoding int encoding)Called when the audio processor is flushed with a format of subsequent input. |
void |
handleBuffer(ByteBuffer buffer)Called when data is written to the audio processor. |
Public constructors
WaveformAudioBufferSink
public WaveformAudioBufferSink(
int barsPerSecond,
int outputChannelCount,
WaveformAudioBufferSink.Listener listener
)
Creates a new instance.
| Parameters | |
|---|---|
int barsPerSecond |
The number of bars that should be generated per each second of audio. |
int outputChannelCount |
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 |
WaveformAudioBufferSink.Listener listener |
The listener to be notified when a new waveform bar has been generated. |
Public methods
flush
public void flush(int sampleRateHz, int channelCount, @C.PcmEncoding int encoding)
Called when the audio processor is flushed with a format of subsequent input.
handleBuffer
public void handleBuffer(ByteBuffer buffer)
Called when data is written to the audio processor.
| Parameters | |
|---|---|
ByteBuffer buffer |
A read-only buffer containing input which the audio processor will handle. |