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

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

Inheritance diagram for al::Vbap:
al::Spatializer

Public Types

enum  VbapOptions { KEEP_SAME_ELEVATION }
 

Public Member Functions

 Vbap (const Speakers &sl, bool is3D=false)
 
void setOptions (VbapOptions options)
 
virtual void compile () override
 
void makePhantomChannel (int channelIndex, std::vector< unsigned int > assignedOutputs)
 Make an existing channel a phantom channel. More...
 
void set3D (bool is3D)
 
virtual void renderSample (AudioIOData &io, const Pose &reldir, const float &sample, const unsigned int &frameIndex) override
 Render audio sample in position.
 
virtual void renderBuffer (AudioIOData &io, const Pose &reldir, const float *samples, const unsigned int &numFrames) override
 Render audio buffer in position.
 
virtual void print (std::ostream &stream=std::cout) override
 Print out information about spatializer.
 
void makeTriple (int s1, int s2, int s3=-1)
 Manually add a triple from indeces to speakers.
 
std::vector< SpeakerTripletriplets () const
 
virtual void prepare (AudioIOData &io)
 
virtual void finalize (AudioIOData &io)
 
int numSpeakers () const
 Get number of speakers.
 
virtual void numFrames (unsigned int v)
 Set number of frames.
 

Protected Attributes

Speakers mSpeakers
 
std::vector< float > mBuffer
 
unsigned int mNumFrames {0}
 

Detailed Description

Vector-based amplitude panner

Definition at line 87 of file al_Vbap.hpp.

Constructor & Destructor Documentation

◆ Vbap()

al::Vbap::Vbap ( const Speakers sl,
bool  is3D = false 
)
Parameters
[in]slA speaker layout

Member Function Documentation

◆ compile()

virtual void al::Vbap::compile ( )
overridevirtual

Perform any necessary updates when the speaker layout changes, ex. new speaker triplets for VBAP Must be called before any calls to prepare(), renderBuffer(), renderSample() or perform()

Reimplemented from al::Spatializer.

◆ finalize()

virtual void al::Spatializer::finalize ( AudioIOData io)
inlinevirtualinherited

Called once per listener, after sources are rendered. ex. ambisonics decode

Reimplemented in al::AmbisonicsSpatializer.

Definition at line 84 of file al_Spatializer.hpp.

◆ makePhantomChannel()

void al::Vbap::makePhantomChannel ( int  channelIndex,
std::vector< unsigned int >  assignedOutputs 
)

Make an existing channel a phantom channel.

Parameters
channelIndexthe channel index of the phantom channel
assignedOutputsthe list of channel indeces for signal reassignment

Signals that should go out to phantom channels will be distributed among the channels listed in the assignedOutputs vector. This can be useful to force triangulation in unusual situations (e.g. three rings on a sphere...) but it can also be used creatively to make an area in space be reassigned somewhere else, or to a wider number of speakers.

◆ prepare()

virtual void al::Spatializer::prepare ( AudioIOData io)
inlinevirtualinherited

Called once per listener, before sources are rendered. ex. zero ambisonics coefficients

Reimplemented in al::Lbap, and al::AmbisonicsSpatializer.

Definition at line 70 of file al_Spatializer.hpp.

◆ set3D()

void al::Vbap::set3D ( bool  is3D)
inline

Set whether VBAP will use 3D (triangles) or 2D (speaker pairs) You must call compile after this function to ensure triples are recomputed

Definition at line 118 of file al_Vbap.hpp.


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