Audaspace 1.5.0
A high level audio library.
Loading...
Searching...
No Matches
Public Member Functions | List of all members
HRTF Class Reference

This class represents a complete set of HRTFs. More...

#include <HRTF.h>

Public Member Functions

 HRTF ()
 Creates a new empty HRTF object that will instance it own FFTPlan with default size.
 
 HRTF (std::shared_ptr< FFTPlan > plan)
 Creates a new empty HRTF object.
 
bool addImpulseResponse (std::shared_ptr< StreamBuffer > impulseResponse, float azimuth, float elevation)
 Adds a new HRTF to the class.
 
std::pair< std::shared_ptr< ImpulseResponse >, std::shared_ptr< ImpulseResponse > > getImpulseResponse (float &azimuth, float &elevation)
 Retrieves a pair of HRTFs for a certain azimuth and elevation.
 
Specs getSpecs ()
 Retrieves the specs shared by all the HRTFs.
 
bool isEmpty ()
 Retrieves the state of the HRTF object.
 

Detailed Description

This class represents a complete set of HRTFs.

Constructor & Destructor Documentation

◆ HRTF()

HRTF::HRTF ( std::shared_ptr< FFTPlan > plan)

Creates a new empty HRTF object.

Parameters
planA shared pointer to a FFT plan used to transform the impulse responses added.

Member Function Documentation

◆ addImpulseResponse()

bool HRTF::addImpulseResponse ( std::shared_ptr< StreamBuffer > impulseResponse,
float azimuth,
float elevation )

Adds a new HRTF to the class.

Parameters
impulseResponseA shared pointer to an StreamBuffer with the HRTF.
azimuthThe azimuth angle of the HRTF. Interval [0,360).
elevationThe elevation angle of the HRTF.
Returns
True if the impulse response was added successfully, false otherwise (the specs weren't correct).

◆ getImpulseResponse()

std::pair< std::shared_ptr< ImpulseResponse >, std::shared_ptr< ImpulseResponse > > HRTF::getImpulseResponse ( float & azimuth,
float & elevation )

Retrieves a pair of HRTFs for a certain azimuth and elevation.

If no exact match is found, the closest ones will be chosen (the elevation has priority over the azimuth).

Parameters
[in,out]azimuthThe desired azimuth angle. If no exact match is found, the value of azimuth will represent the actual azimuth elevation of the chosen HRTF. Interval [0,360)
[in,out]elevationThe desired elevation angle. If no exact match is found, the value of elevation will represent the actual elevation angle of the chosen HRTF.
Returns
A pair of shared pointers to ImpulseResponse objects containing the HRTFs for the left (first element) and right (second element) ears.

◆ getSpecs()

Specs HRTF::getSpecs ( )

Retrieves the specs shared by all the HRTFs.

Returns
The shared specs of all the HRTFs.

◆ isEmpty()

bool HRTF::isEmpty ( )

Retrieves the state of the HRTF object.

Returns
True if it is empty, false otherwise.

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