ManifoldMusic
music visualization
 All Classes Files Functions Variables Enumerations Enumerator
Public Member Functions | Protected Attributes | List of all members
Audio Class Reference

responsible for all audio signal related tasks. More...

#include <audio.h>

Public Member Functions

 Audio ()
 default constructor
 
 ~Audio ()
 destructor
 
bool loadSong (const char *path)
 
void rePlay ()
 
bool playPause ()
 
void getFilter (VectorXd *filter)
 
void setFreqs (int _numFreqs)
 
void updateEQ (EQType t, int val)
 

Protected Attributes

bool ready
 
float * left
 
float * right
 
float * eq
 
float low
 
float mid
 
float high
 
FMOD::System * system
 
FMOD::Channel * channel
 
FMOD::Sound * sound
 
int numFreqs
 

Detailed Description

responsible for all audio signal related tasks.

Member Function Documentation

void Audio::getFilter ( VectorXd *  filter)
Returns a filter which can be applied to the MHT.

The filter is composed of the frequency spectrum of the currently playing audio file and a weight function, which the user can manipulate (see updateEQ()).

Parameters
filtera buffer to which the filter will be written.
bool Audio::loadSong ( const char *  path)
Loads song from specified source and starts playback.
Parameters
pathpath to an audio file
bool Audio::playPause ( )

Pause/unpause song.

void Audio::rePlay ( )

Restarts song from beginning.

void Audio::setFreqs ( int  _numFreqs)
inline
Sets the number of frequency bands that should be extracted from the audio stream/delivered as filter.
Parameters
_numFreqsnew number of frequency bands
void Audio::updateEQ ( EQType  t,
int  val 
)
Updates the equalizer function.

The equalizer function is vector of numHarmonics weights. In [0, numFreqs/4-1] (first fourth) it is a linear interpolation between low/2 and mid*2. In [numFreqs/4, numFreqs-1] (rest) we interpolate between mid*2 and high*10. low, mid and high must range between 0 and 2.

Parameters
ttype of parameter that should be updated
valnew value for that parameter (must range between 0 and 200, has no effect if t=FREQS)

Member Data Documentation

FMOD::Channel* Audio::channel
protected

see fmod documentation

float* Audio::eq
protected

storage of equalizer function

float Audio::high
protected

parameter that influences weight of high frequencies

float* Audio::left
protected

buffer for frequency spectrum of left channel

float Audio::low
protected

parameter that influences weight of low frequencies

float Audio::mid
protected

parameter that influences weight of midrange frequencies

int Audio::numFreqs
protected

a duplicate of Config::numFreqs; actually completely useless.

bool Audio::ready
protected

indicates if a song has already been loaded

float* Audio::right
protected

buffer for frequency spectrum of right channel

FMOD::Sound* Audio::sound
protected

see fmod documentation

FMOD::System* Audio::system
protected

see fmod documentation


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