Allolib  1.0
C++ Components For Interactive Multimedia
al::AmbiDecode Class Reference

#include <C:/Users/Andres/source/repos/casm_viewer/external/tinc/external/allolib/include/al/sound/al_Ambisonics.hpp>

Inheritance diagram for al::AmbiDecode:
al::AmbiBase

Public Member Functions

 AmbiDecode (int dim, int order, int numSpeakers, int flavor=1)
 
virtual void decode (float *dec, const float *enc, int numDecFrames) const
 
float decodeWeight (int speaker, int channel) const
 
int flavor () const
 Returns decode flavor.
 
int numSpeakers () const
 Returns number of speakers.
 
void print (std::ostream &stream) const
 
void flavor (int type)
 Set decoding algorithm.
 
void numSpeakers (int num)
 Set number of speakers. Positions are zeroed upon resize.
 
void setSpeakerRadians (int index, int deviceChannel, float azimuth, float elevation, float amp=1.f)
 
void setSpeaker (int index, int deviceChannel, float azimuth, float elevation=0, float amp=1.f)
 
void setSpeakers (Speakers *spkrs)
 
void setSpeakers (Speakers &spkrs)
 
Speakerspeaker (int num)
 Get speaker.
 
virtual void onChannelsChange ()
 Called whenever the number of Ambisonic channels changes.
 
int dim () const
 Get number dimensions.
 
void dim (int dim)
 Set the number of dimensions.
 
int order () const
 Get order.
 
void order (int order)
 Set the order.
 
const float * weights () const
 Get Ambisonic channel weights.
 
int channels () const
 Returns total number of Ambisonic domain (B-format) channels.
 

Static Public Member Functions

static int channelsToUniformOrder (int channels)
 
static void encodeWeightsFuMa (float *weights, int dim, int order, float azimuth, float elevation)
 
static void encodeWeightsFuMa (float *ws, int dim, int order, float x, float y, float z)
 
static void encodeWeightsFuMa16 (float *weights, float azimuth, float elevation)
 Brute force 3rd order. Weights must be of size 16.
 
static void encodeWeightsFuMa16 (float *ws, float x, float y, float z)
 (x,y,z unit vector in the listener's coordinate frame)
 
static int orderToChannels (int dim, int order)
 
static int orderToChannelsH (int orderH)
 
static int orderToChannelsV (int orderV)
 
static int channelsToOrder (int channels)
 
static int channelsToDimensions (int channels)
 

Protected Member Functions

void updateChanWeights ()
 
void resizeArrays (int numChannels, int numSpeakers)
 
float decode (float *encFrame, int encNumChannels, int speakerNum)
 

Static Protected Member Functions

template<typename T >
static void resize (T *&a, int n)
 

Protected Attributes

int mNumSpeakers
 
int mFlavor
 
float * mDecodeMatrix
 
float mWOrder [5]
 
Speakers mSpeakers
 
int mDim
 
int mOrder
 
int mChannels
 
float * mWeights
 

Static Protected Attributes

static float flavorWeights [4][5][5]
 

Detailed Description

Higher Order Ambisonic Decoding class

Definition at line 180 of file al_Ambisonics.hpp.

Constructor & Destructor Documentation

◆ AmbiDecode()

al::AmbiDecode::AmbiDecode ( int  dim,
int  order,
int  numSpeakers,
int  flavor = 1 
)
Parameters
[in]dimnumber of spatial dimensions (2 or 3)
[in]orderhighest spherical harmonic order
[in]numSpeakersnumber of speakers
[in]flavordecoding algorithm

Member Function Documentation

◆ decode()

virtual void al::AmbiDecode::decode ( float *  dec,
const float *  enc,
int  numDecFrames 
) const
virtual
Parameters
[out]decoutput time domain buffers (non-interleaved)
[in]encinput Ambisonic domain buffers (non-interleaved)
[in]numDecFramesnumber of frames in time domain buffers

◆ encodeWeightsFuMa() [1/2]

static void al::AmbiBase::encodeWeightsFuMa ( float *  weights,
int  dim,
int  order,
float  azimuth,
float  elevation 
)
staticinherited

Compute spherical harmonic weights based on azimuth and elevation azimuth is anti-clockwise; both azimuth and elevation are in degrees

◆ encodeWeightsFuMa() [2/2]

static void al::AmbiBase::encodeWeightsFuMa ( float *  ws,
int  dim,
int  order,
float  x,
float  y,
float  z 
)
staticinherited

Compute spherical harmonic weights based on unit direction vector (in the listener's coordinate frame)


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