JUCE-7.0.12-0-g4f43011b96 JUCE-7.0.12-0-g4f43011b96
JUCE — C++ application framework with suport for VST, VST3, LV2 audio plug-ins

« « « Anklang Documentation
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
juce::Decibels Class Reference

This class contains some helpful static methods for dealing with decibel values. More...

#include "juce_Decibels.h"

Static Public Member Functions

template<typename Type >
static Type decibelsToGain (Type decibels, Type minusInfinityDb=Type(defaultMinusInfinitydB))
 Converts a dBFS value to its equivalent gain level.
 
template<typename Type >
static Type gainToDecibels (Type gain, Type minusInfinityDb=Type(defaultMinusInfinitydB))
 Converts a gain level into a dBFS value.
 
template<typename Type >
static Type gainWithLowerBound (Type gain, Type lowerBoundDb)
 Restricts a gain value based on a lower bound specified in dBFS.
 
template<typename Type >
static String toString (Type decibels, int decimalPlaces=2, Type minusInfinityDb=Type(defaultMinusInfinitydB), bool shouldIncludeSuffix=true, StringRef customMinusInfinityString={})
 Converts a decibel reading to a string.
 

Detailed Description

This class contains some helpful static methods for dealing with decibel values.

@tags{Audio}

Definition at line 32 of file juce_Decibels.h.

Member Function Documentation

◆ decibelsToGain()

template<typename Type >
static Type juce::Decibels::decibelsToGain ( Type  decibels,
Type  minusInfinityDb = Type (defaultMinusInfinitydB) 
)
static

Converts a dBFS value to its equivalent gain level.

A gain of 1.0 = 0 dB, and lower gains map onto negative decibel values. Any decibel value lower than minusInfinityDb will return a gain of 0.

Definition at line 42 of file juce_Decibels.h.

◆ gainToDecibels()

template<typename Type >
static Type juce::Decibels::gainToDecibels ( Type  gain,
Type  minusInfinityDb = Type (defaultMinusInfinitydB) 
)
static

Converts a gain level into a dBFS value.

A gain of 1.0 = 0 dB, and lower gains map onto negative decibel values. If the gain is 0 (or negative), then the method will return the value provided as minusInfinityDb.

Definition at line 56 of file juce_Decibels.h.

◆ gainWithLowerBound()

template<typename Type >
static Type juce::Decibels::gainWithLowerBound ( Type  gain,
Type  lowerBoundDb 
)
static

Restricts a gain value based on a lower bound specified in dBFS.

This is useful if you want to make sure a gain value never reaches zero.

Definition at line 68 of file juce_Decibels.h.

◆ toString()

template<typename Type >
static String juce::Decibels::toString ( Type  decibels,
int  decimalPlaces = 2,
Type  minusInfinityDb = Type (defaultMinusInfinitydB),
bool  shouldIncludeSuffix = true,
StringRef  customMinusInfinityString = {} 
)
static

Converts a decibel reading to a string.

By default the returned string will have the 'dB' suffix added, but this can be removed by setting the shouldIncludeSuffix argument to false. If a customMinusInfinityString argument is provided this will be returned if the value is lower than minusInfinityDb, otherwise the return value will be "-INF".

Definition at line 86 of file juce_Decibels.h.


The documentation for this class was generated from the following file: