arduino-audio-tools
Static Public Member Functions | List of all members
NumberConverter Class Reference

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

#include <AudioTypes.h>

Static Public Member Functions

template<typename T >
static T clip (int64_t value)
 Clips the value to avoid any over or underflows.
 
template<typename FromT , typename ToT >
static ToT convert (FromT value)
 Convert a number from one type to another.
 
static int16_t convert16 (int value, int value_bits_per_sample)
 
static int16_t convert8 (int value, int value_bits_per_sample)
 
template<typename FromT , typename ToT >
static void convertArray (FromT *from, ToT *to, int samples, float vol=1.0f)
 
static int16_t convertFrom24To16 (int24_t value)
 
static int32_t convertFrom24To32 (int24_t value)
 
static float convertFrom24ToFloat (int24_t value)
 
static int16_t convertFrom32To16 (int32_t value)
 
static int64_t maxValue (int value_bits_per_sample)
 provides the biggest number for the indicated number of bits
 
template<typename T >
static int64_t maxValueT ()
 provides the biggest number for the indicated type
 

Detailed Description

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


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