MCPcopy Create free account
hub / github.com/LabSound/LabSound / linearToDecibels

Method linearToDecibels

src/internal/src/AudioUtilities.cpp:15–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13}
14
15float lab::AudioUtilities::linearToDecibels(float linear)
16{
17 // It's not possible to calculate decibels for a zero linear value since it would be -Inf.
18 // -1000.0 dB represents a very tiny linear value in case we ever reach this case.
19 if (!linear) return -1000.0;
20 return (20.f * std::log10(linear));
21}
22
23double lab::AudioUtilities::discreteTimeConstantForSampleRate(double timeConstant, double sampleRate)
24{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected