class VolumeCurve
Defined at line 17 of file ../../src/media/audio/audio_core/volume_curve.h
A gain curve is a continuous increasing piecewise linear function that maps from volume over the
domain [0.0, 1.0] to gain in dbfs.
Public Members
static const float kDefaultGainForMinVolume
Public Methods
VolumeCurve DefaultForMinGain (float min_gain_db)
A default gain curve to use when the curve of the device is unknown, but its minimum gain is
known.
Defined at line 27 of file ../../src/media/audio/audio_core/volume_curve.cc
fpromise::result<VolumeCurve, std::string> FromMappings (std::vector<VolumeMapping> mappings)
Attempts to construct a curve from a mapping from volume domain to gain in dbfs. Mappings must
represent a continuous increasing function from volume to gain in dbfs over the volume domain
[0.0, 1.0]. The gain range must start with a negative value and end exactly at 0.0.
Defined at line 48 of file ../../src/media/audio/audio_core/volume_curve.cc
const std::vector<VolumeMapping> & mappings ()
Returns the set of underlying mappings for this curve.
Defined at line 49 of file ../../src/media/audio/audio_core/volume_curve.h
float VolumeToDb (float volume)
Samples the gain curve for the dbfs value at `volume`. Outside of [0.0, 1.0], the volume is
clamped before sampling.
Defined at line 88 of file ../../src/media/audio/audio_core/volume_curve.cc
float DbToVolume (float gain_dbfs)
Samples the gain curve for the volume value at `gain_dbfs`. Outside of [-160.0, 0.0], the gain
is clamped before sampling.
Defined at line 110 of file ../../src/media/audio/audio_core/volume_curve.cc