Switchboard SDK
Loading...
Searching...
No Matches
switchboard::VUMeterNode Class Reference

Analyzes the audio and returns the RMS power of the signal per buffer. It only accepts mono buffers. More...

#include <VUMeterNode.hpp>

Inheritance diagram for switchboard::VUMeterNode:

Public Member Functions

 SB_WASM_EXPORT (VUMeterNode)
 
SB_WASM VUMeterNode ()
 Creates a VUMeterNode instance.
 
SB_WASM ~VUMeterNode ()
 VUMeterNode destructor.
 
SB_WASM void setSmoothingDurationMs (const float smoothingDurationMs)
 Set the window duration on which to average the current levels.
 
SB_WASM const float getSmoothingDurationMs () const
 Returns the window duration on which to average the current levels.
 
SB_WASM const float getLevel () const
 Returns the last buffers RMS value as amplitude.
 
SB_WASM const float getLevelDBFS () const
 Returns the last buffers RMS value as dBFS.
 
SB_WASM const float getPeak () const
 Returns the last buffers peak value as amplitude.
 
SB_WASM const float getPeakDBFS () const
 Returns the last buffers peak value as dBFS.
 
SB_WASM bool setBusFormat (AudioBusFormat &busFormat) override
 
SB_WASM bool consume (AudioBus &bus) override
 

Detailed Description

Analyzes the audio and returns the RMS power of the signal per buffer. It only accepts mono buffers.

VUMeterNode class

Member Function Documentation

◆ getLevel()

const float switchboard::VUMeterNode::getLevel ( ) const

Returns the last buffers RMS value as amplitude.

Returns
The last buffers RMS value as amplitude.

◆ getLevelDBFS()

const float switchboard::VUMeterNode::getLevelDBFS ( ) const

Returns the last buffers RMS value as dBFS.

Returns
The last buffers RMS value as dBFS.

◆ getPeak()

const float switchboard::VUMeterNode::getPeak ( ) const

Returns the last buffers peak value as amplitude.

Returns
The last buffers peak value as amplitude.

◆ getPeakDBFS()

const float switchboard::VUMeterNode::getPeakDBFS ( ) const

Returns the last buffers peak value as dBFS.

Returns
The last buffers peak value as dBFS.

◆ getSmoothingDurationMs()

const float switchboard::VUMeterNode::getSmoothingDurationMs ( ) const

Returns the window duration on which to average the current levels.

Returns
The window on which to average the current levels in milliseconds.

◆ setSmoothingDurationMs()

void switchboard::VUMeterNode::setSmoothingDurationMs ( const float smoothingDurationMs)

Set the window duration on which to average the current levels.

This method is not safe to call while the node is running (the nodes consume method is being called).

This method sets the preferred duration but the actual duration will depend on the current sample rate and number of frames.

It will be chosen to be as close to the preferred as it can be.

Parameters
smoothingDurationMsWindow duration on which to average the current levels.