WaveformAudioBufferSink.WaveformBar


class WaveformAudioBufferSink.WaveformBar


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

Summary

Public constructors

Public functions

Unit
addSample(sample: @FloatRange(from = "-1", to = 1) Float)

Adds a new sample to the group.

Double

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

Double

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

Double

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

Public properties

Int

Public constructors

WaveformBar

WaveformBar()

Public functions

addSample

fun addSample(sample: @FloatRange(from = "-1", to = 1) Float): Unit

Adds a new sample to the group.

Parameters
sample: @FloatRange(from = "-1", to = 1) Float

The sample value, between -1 and +1.

getMaxSampleValue

fun getMaxSampleValue(): Double

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

getMinSampleValue

fun getMinSampleValue(): Double

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

getRootMeanSquare

fun getRootMeanSquare(): Double

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 properties

sampleCount

val sampleCountInt