arduino-audio-tools
Loading...
Searching...
No Matches
ConverterScaler< T > Class Template Reference

Multiplies the values with the indicated factor adds the offset and clips at maxValue. To mute use a factor of 0.0! More...

#include <CodecOpusOgg.h>

Inheritance diagram for ConverterScaler< T >:
BaseConverter BaseConverter

Public Member Functions

 ConverterScaler (float factor, T offset, T maxValue, int channels=2)
 ConverterScaler (float factor, T offset, T maxValue, int channels=2)
size_t convert (uint8_t *src, size_t byte_count)
size_t convert (uint8_t *src, size_t byte_count)
float factor ()
 Determines the actual factor (volume).
float factor ()
 Determines the actual factor (volume).
T offset ()
 Determines the offset value.
T offset ()
 Determines the offset value.
void setFactor (float factor)
 Defines the factor (volume).
void setFactor (float factor)
 Defines the factor (volume).
void setOffset (T offset)
 Defines the offset.
void setOffset (T offset)
 Defines the offset.

Protected Types

using acc_t = float
using acc_t = float

Protected Attributes

int channels
acc_t factor_value {0.0f}
T maxValue
T offset_value

Detailed Description

template<typename T = int16_t>
class audio_tools::audio_tools::ConverterScaler< T >

Multiplies the values with the indicated factor adds the offset and clips at maxValue. To mute use a factor of 0.0!

Author
Phil Schatzmann
Template Parameters
T

Member Typedef Documentation

◆ acc_t [1/2]

template<typename T = int16_t>
using acc_t = float
protected

◆ acc_t [2/2]

template<typename T = int16_t>
using acc_t = float
protected

Constructor & Destructor Documentation

◆ ConverterScaler() [1/2]

template<typename T = int16_t>
ConverterScaler ( float factor,
T offset,
T maxValue,
int channels = 2 )
inline

◆ ConverterScaler() [2/2]

template<typename T = int16_t>
ConverterScaler ( float factor,
T offset,
T maxValue,
int channels = 2 )
inline

Member Function Documentation

◆ convert() [1/2]

template<typename T = int16_t>
size_t convert ( uint8_t * src,
size_t byte_count )
inlinevirtual

Implements BaseConverter.

◆ convert() [2/2]

template<typename T = int16_t>
size_t convert ( uint8_t * src,
size_t byte_count )
inlinevirtual

Implements BaseConverter.

◆ factor() [1/2]

template<typename T = int16_t>
float factor ( )
inline

Determines the actual factor (volume).

◆ factor() [2/2]

template<typename T = int16_t>
float factor ( )
inline

Determines the actual factor (volume).

◆ offset() [1/2]

template<typename T = int16_t>
T offset ( )
inline

Determines the offset value.

◆ offset() [2/2]

template<typename T = int16_t>
T offset ( )
inline

Determines the offset value.

◆ setFactor() [1/2]

template<typename T = int16_t>
void setFactor ( float factor)
inline

Defines the factor (volume).

◆ setFactor() [2/2]

template<typename T = int16_t>
void setFactor ( float factor)
inline

Defines the factor (volume).

◆ setOffset() [1/2]

template<typename T = int16_t>
void setOffset ( T offset)
inline

Defines the offset.

◆ setOffset() [2/2]

template<typename T = int16_t>
void setOffset ( T offset)
inline

Defines the offset.

Member Data Documentation

◆ channels

template<typename T = int16_t>
int channels
protected

◆ factor_value

template<typename T = int16_t>
acc_t factor_value {0.0f}
protected

◆ maxValue

template<typename T = int16_t>
T maxValue
protected

◆ offset_value

template<typename T = int16_t>
T offset_value
protected

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