public class

WaveformAudioBufferSink.WaveformBar

extends java.lang.Object

 java.lang.Object

↳androidx.media3.exoplayer.audio.WaveformAudioBufferSink.WaveformBar

Overview

Aggregates a group of audio samples. The values exposed can be used to draw one vertical bar of an audio waveform.

Summary

Constructors
publicWaveformBar()

Methods
public voidaddSample(float sample)

Adds a new sample to the group.

public doublegetMaxSampleValue()

Returns the maximum sample value in this group, normalized between -1 and +1.

public doublegetMinSampleValue()

Returns the minimum sample value in this group, normalized between -1 and +1.

public doublegetRootMeanSquare()

Returns the RMS (Root Mean Square) of the samples in this group, normalized between -1 and +1.

public intgetSampleCount()

Returns the number of samples added.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public WaveformBar()

Methods

public int getSampleCount()

Returns the number of samples added.

public double getMinSampleValue()

Returns the minimum sample value in this group, normalized between -1 and +1.

public double getMaxSampleValue()

Returns the maximum sample value in this group, normalized between -1 and +1.

public double getRootMeanSquare()

Returns the RMS (Root Mean Square) of the samples in this group, normalized between -1 and +1.

This an estimate of the audio loudness level.

public void addSample(float sample)

Adds a new sample to the group.

Parameters:

sample: The sample value, between -1 and +1.