arduino-audio-tools
Loading...
Searching...
No Matches
NumberConverter Class Reference

Converts from a source to a target number with a different type. More...

#include <CodecOpusOgg.h>

Static Public Member Functions

static int32_t clip (float value, int bits)
 clips a value
static int32_t clip (float value, int bits)
 clips a value
template<typename T>
static T clipT (float value)
 Clips the value to avoid any over or underflows.
template<typename T>
static T clipT (float value)
 Clips the value to avoid any over or underflows.
template<typename FromT, typename ToT>
static ToT convert (FromT value)
 Convert an int number from one type to another.
template<typename FromT, typename ToT>
static ToT convert (FromT value)
 Convert an int number from one type to another.
template<typename FromT, typename ToT>
static void convertArray (FromT *from, ToT *to, int samples, float vol=1.0f)
 Convert an array of int types.
template<typename FromT, typename ToT>
static void convertArray (FromT *from, ToT *to, int samples, float vol=1.0f)
 Convert an array of int types.
static int32_t fromFloat (float value, int bits)
 Convert a float (with max 1.0) to an integer autio type.
static int32_t fromFloat (float value, int bits)
 Convert a float (with max 1.0) to an integer autio type.
template<typename T>
static T fromFloatT (float value)
 Convert a float (with max 1.0) to an integer autio type.
template<typename T>
static T fromFloatT (float value)
 Convert a float (with max 1.0) to an integer autio type.
static int64_t maxValue (int value_bits_per_sample)
 provides the biggest number for the indicated number of bits
static int64_t maxValue (int value_bits_per_sample)
 provides the biggest number for the indicated number of bits
template<typename T>
static float maxValueT ()
 provides the biggest number for the indicated type
template<typename T>
static float maxValueT ()
 provides the biggest number for the indicated type
template<typename T>
static float minValueT ()
template<typename T>
static float minValueT ()
static float toFloat (int32_t value, int bits)
 Convert an integer integer autio type to a float (with max 1.0).
static float toFloat (int32_t value, int bits)
 Convert an integer integer autio type to a float (with max 1.0).
template<typename T>
static float toFloatT (T value)
 Convert an integer integer autio type to a float (with max 1.0).
template<typename T>
static float toFloatT (T value)
 Convert an integer integer autio type to a float (with max 1.0).

Detailed Description

Converts from a source to a target number with a different type.

Member Function Documentation

◆ clip() [1/2]

int32_t clip ( float value,
int bits )
inlinestatic

clips a value

◆ clip() [2/2]

int32_t clip ( float value,
int bits )
inlinestatic

clips a value

◆ clipT() [1/2]

template<typename T>
T clipT ( float value)
inlinestatic

Clips the value to avoid any over or underflows.

◆ clipT() [2/2]

template<typename T>
T clipT ( float value)
inlinestatic

Clips the value to avoid any over or underflows.

◆ convert() [1/2]

template<typename FromT, typename ToT>
ToT convert ( FromT value)
inlinestatic

Convert an int number from one type to another.

◆ convert() [2/2]

template<typename FromT, typename ToT>
ToT convert ( FromT value)
inlinestatic

Convert an int number from one type to another.

◆ convertArray() [1/2]

template<typename FromT, typename ToT>
void convertArray ( FromT * from,
ToT * to,
int samples,
float vol = 1.0f )
inlinestatic

Convert an array of int types.

◆ convertArray() [2/2]

template<typename FromT, typename ToT>
void convertArray ( FromT * from,
ToT * to,
int samples,
float vol = 1.0f )
inlinestatic

Convert an array of int types.

◆ fromFloat() [1/2]

int32_t fromFloat ( float value,
int bits )
inlinestatic

Convert a float (with max 1.0) to an integer autio type.

◆ fromFloat() [2/2]

int32_t fromFloat ( float value,
int bits )
inlinestatic

Convert a float (with max 1.0) to an integer autio type.

◆ fromFloatT() [1/2]

template<typename T>
T fromFloatT ( float value)
inlinestatic

Convert a float (with max 1.0) to an integer autio type.

◆ fromFloatT() [2/2]

template<typename T>
T fromFloatT ( float value)
inlinestatic

Convert a float (with max 1.0) to an integer autio type.

◆ maxValue() [1/2]

int64_t maxValue ( int value_bits_per_sample)
inlinestatic

provides the biggest number for the indicated number of bits

◆ maxValue() [2/2]

int64_t maxValue ( int value_bits_per_sample)
inlinestatic

provides the biggest number for the indicated number of bits

◆ maxValueT() [1/2]

template<typename T>
float maxValueT ( )
inlinestatic

provides the biggest number for the indicated type

◆ maxValueT() [2/2]

template<typename T>
float maxValueT ( )
inlinestatic

provides the biggest number for the indicated type

◆ minValueT() [1/2]

template<typename T>
float minValueT ( )
inlinestatic

◆ minValueT() [2/2]

template<typename T>
float minValueT ( )
inlinestatic

◆ toFloat() [1/2]

float toFloat ( int32_t value,
int bits )
inlinestatic

Convert an integer integer autio type to a float (with max 1.0).

◆ toFloat() [2/2]

float toFloat ( int32_t value,
int bits )
inlinestatic

Convert an integer integer autio type to a float (with max 1.0).

◆ toFloatT() [1/2]

template<typename T>
float toFloatT ( T value)
inlinestatic

Convert an integer integer autio type to a float (with max 1.0).

◆ toFloatT() [2/2]

template<typename T>
float toFloatT ( T value)
inlinestatic

Convert an integer integer autio type to a float (with max 1.0).


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