SAF
Loading...
Searching...
No Matches
ambi_bin.h File Reference

A binaural Ambisonic decoder for reproducing Ambisonic sound scenes over headphones. More...

#include "_common.h"

Go to the source code of this file.

Macros

#define AMBI_BIN_NUM_DECODING_METHODS   ( 5 )
 Number of decoding method options.
 
#define AMBI_BIN_NUM_HRIR_PREPROC_OPTIONS   ( 4 )
 Number of HRIR pre-preprocessing options.
 

Enumerations

enum  AMBI_BIN_DECODING_METHODS {
  DECODING_METHOD_LS = 1 , DECODING_METHOD_LSDIFFEQ , DECODING_METHOD_SPR , DECODING_METHOD_TA ,
  DECODING_METHOD_MAGLS
}
 Available decoding methods for the ambi_bin example. More...
 
enum  AMBI_BIN_PREPROC { HRIR_PREPROC_OFF = 1 , HRIR_PREPROC_EQ , HRIR_PREPROC_PHASE , HRIR_PREPROC_ALL }
 Available HRIR pre-preprocessing options. More...
 

Functions

void ambi_bin_create (void **const phAmbi)
 Creates an instance of ambi_bin.
 
void ambi_bin_destroy (void **const phAmbi)
 Destroys an instance of ambi_bin.
 
void ambi_bin_init (void *const hAmbi, int samplerate)
 Initialises ambi_bin with default settings, and samplerate.
 
void ambi_bin_initCodec (void *const hAmbi)
 Intialises the codec variables, based on current global/user parameters.
 
void ambi_bin_process (void *const hAmbi, const float *const *inputs, float *const *const outputs, int nInputs, int nOutputs, int nSamples)
 Decodes input spherical harmonic signals to the binaural channels.
 
void ambi_bin_refreshParams (void *const hAmbi)
 Sets intialisation flags to 1, so as to re-initialise all settings/variables (as ambi_bin is currently configured), at next available opportunity.
 
void ambi_bin_setUseDefaultHRIRsflag (void *const hAmbi, int newState)
 Sets flag to dictate whether the default HRIRs in the Spatial_Audio_Framework should be used, or a custom HRIR set loaded via a SOFA file.
 
void ambi_bin_setSofaFilePath (void *const hAmbi, const char *path)
 Sets the file path for a .sofa file, in order to employ a custom HRIR set for the decoding.
 
void ambi_bin_setInputOrderPreset (void *const hAmbi, SH_ORDERS newPreset)
 Sets the decoding order (see SH_ORDERS enum)
 
void ambi_bin_setDecodingMethod (void *const hAmbi, AMBI_BIN_DECODING_METHODS newMethod)
 Sets the decoding method (see AMBI_BIN_DECODING_METHODS enum)
 
void ambi_bin_setChOrder (void *const hAmbi, int newOrder)
 Sets the Ambisonic channel ordering convention to decode with, in order to match the convention employed by the input signals.
 
void ambi_bin_setNormType (void *const hAmbi, int newType)
 Sets the Ambisonic normalisation convention to decode with, in order to match with the convention employed by the input signals.
 
void ambi_bin_setEnableMaxRE (void *const hAmbi, int newState)
 Sets a flag to enable/disable the max_rE weighting.
 
void ambi_bin_setEnableDiffuseMatching (void *const hAmbi, int newState)
 Sets a flag to enable/disable (1 or 0) the diffuse-covariance constraint.
 
void ambi_bin_setEnableTruncationEQ (void *const hAmbi, int newState)
 Sets a flag to enable/disable (1 or 0) truncation EQ.
 
void ambi_bin_setHRIRsPreProc (void *const hAmbi, AMBI_BIN_PREPROC newType)
 Sets HRIR pre-processing strategy (see AMBI_BIN_PREPROC enum)
 
void ambi_bin_setEnableRotation (void *const hAmbi, int newState)
 Sets the flag to enable/disable (1 or 0) sound-field rotation.
 
void ambi_bin_setYaw (void *const hAmbi, float newYaw_deg)
 Sets the 'yaw' rotation angle, in degrees.
 
void ambi_bin_setPitch (void *const hAmbi, float newPitch)
 Sets the 'pitch' rotation angle, in degrees.
 
void ambi_bin_setRoll (void *const hAmbi, float newRoll)
 Sets the 'roll' rotation angle, in degrees.
 
void ambi_bin_setFlipYaw (void *const hAmbi, int newState)
 Sets a flag as to whether to "flip" the sign of the current 'yaw' angle.
 
void ambi_bin_setFlipPitch (void *const hAmbi, int newState)
 Sets a flag as to whether to "flip" the sign of the current 'pitch' angle.
 
void ambi_bin_setFlipRoll (void *const hAmbi, int newState)
 Sets a flag as to whether to "flip" the sign of the current 'roll' angle.
 
void ambi_bin_setRPYflag (void *const hAmbi, int newState)
 Sets a flag as to whether to use "yaw-pitch-roll" (0) or "roll-pitch-yaw" (1) rotation order.
 
int ambi_bin_getFrameSize (void)
 Returns the processing framesize (i.e., number of samples processed with every _process() call )
 
CODEC_STATUS ambi_bin_getCodecStatus (void *const hAmbi)
 Returns current codec status, see CODEC_STATUS enum.
 
float ambi_bin_getProgressBar0_1 (void *const hAmbi)
 (Optional) Returns current intialisation/processing progress, between 0..1
 
void ambi_bin_getProgressBarText (void *const hAmbi, char *text)
 (Optional) Returns current intialisation/processing progress text
 
int ambi_bin_getUseDefaultHRIRsflag (void *const hAmbi)
 Returns the value of a flag used to dictate whether the default HRIRs in the Spatial_Audio_Framework should be used (1), or a custom HRIR set loaded via a SOFA file (0).
 
int ambi_bin_getInputOrderPreset (void *const hAmbi)
 Returns the decoding order.
 
AMBI_BIN_DECODING_METHODS ambi_bin_getDecodingMethod (void *const hAmbi)
 Returns the currently selected decoding method (see AMBI_BIN_DECODING_METHODS enum)
 
char * ambi_bin_getSofaFilePath (void *const hAmbi)
 Returns the file path for a .sofa file.
 
int ambi_bin_getChOrder (void *const hAmbi)
 Returns the Ambisonic channel ordering convention currently being used to decode with, which should match the convention employed by the input signals (see CH_ORDER enum)
 
int ambi_bin_getNormType (void *const hAmbi)
 Returns the Ambisonic normalisation convention currently being usedto decode with, which should match the convention employed by the input signals (see NORM_TYPES enum).
 
int ambi_bin_getNumEars (void)
 Returns the number of ears possessed by the average homo sapien (2)
 
int ambi_bin_getNSHrequired (void *const hAmbi)
 Returns the number of spherical harmonic signals required by the current decoding order: (current_order+1)^2.
 
int ambi_bin_getEnableMaxRE (void *const hAmbi)
 Returns the flag value which dictates whether to enable/disable maxrE weighting ('0' disabled, '1' enabled).
 
int ambi_bin_getEnableDiffuseMatching (void *const hAmbi)
 Returns the flag value which dictates whether the diffuse covariance contraint is currently enabled ('0' disabled, '1' enabled).
 
int ambi_bin_getEnableTruncationEQ (void *const hAmbi)
 Returns the flag value which dictates whether the truncation EQ is currently enabled ('0' disabled, '1' enabled).
 
AMBI_BIN_PREPROC ambi_bin_getHRIRsPreProc (void *const hAmbi)
 Returns HRIR pre-processing strategy.
 
int ambi_bin_getEnableRotation (void *const hAmbi)
 Returns the flag value which dictates whether to enable/disable sound-field rotation ('0' disabled, '1' enabled).
 
float ambi_bin_getYaw (void *const hAmbi)
 Returns the 'yaw' rotation angle, in degree.
 
float ambi_bin_getPitch (void *const hAmbi)
 Returns the 'pitch' rotation angle, in degrees.
 
float ambi_bin_getRoll (void *const hAmbi)
 Returns the 'roll' rotation angle, in degrees.
 
int ambi_bin_getFlipYaw (void *const hAmbi)
 Returns a flag as to whether to "flip" the sign of the current 'yaw' angle ('0' do not flip sign, '1' flip the sign)
 
int ambi_bin_getFlipPitch (void *const hAmbi)
 Returns a flag as to whether to "flip" the sign of the current 'pitch' angle ('0' do not flip sign, '1' flip the sign)
 
int ambi_bin_getFlipRoll (void *const hAmbi)
 Returns a flag as to whether to "flip" the sign of the current 'roll' angle ('0' do not flip sign, '1' flip the sign)
 
int ambi_bin_getRPYflag (void *const hAmbi)
 Returns a flag as to whether to use "yaw-pitch-roll" (0) or "roll-pitch-yaw" (1) rotation order.
 
int ambi_bin_getNDirs (void *const hAmbi)
 Returns the number of directions in the currently used HRIR set.
 
int ambi_bin_getHRIRlength (void *const hAmbi)
 Returns the length of HRIRs in time-domain samples.
 
int ambi_bin_getHRIRsamplerate (void *const hAmbi)
 Returns the HRIR sample rate.
 
int ambi_bin_getDAWsamplerate (void *const hAmbi)
 Returns the DAW/Host sample rate.
 
int ambi_bin_getProcessingDelay (void)
 Returns the processing delay in samples (may be used for delay compensation features)
 

Detailed Description

A binaural Ambisonic decoder for reproducing Ambisonic sound scenes over headphones.

The decoder offers choice over many different binaural decoding options [1-4] It also supports sound-field rotation for head-tracking and can accomodate loading custom HRIR sets via the SOFA standard.

Test
test__saf_example_ambi_bin()
See also
[1] Z. Ben-Hur, F. Brinkmann, J. Sheaffer, S. Weinzierl, and B. Rafaely, "Spectral equalization in binaural signals represented by order- truncated spherical harmonics" The Journal of the Acoustical Society of America, vol. 141, no. 6, pp. 4087–4096, 2017.
[2] B. Bernschutz, A. V. Giner, C. Po"rschmann, and J. Arend, "Binaural reproduction of plane waves with reduced modal order" Acta Acustica united with Acustica, vol. 100, no. 5, pp. 972–983, 2014. @see [3] Zaunschirm M, Scho"rkhuber C, Ho"ldrich R. Binaural rendering of Ambisonic signals by head-related impulse response time alignment and a diffuseness constraint. The Journal of the Acoustical Society of America. 2018 Jun 19;143(6):3616-27 @see [4] Scho"rkhuber C, Zaunschirm M, Ho"ldrich R. Binaural Rendering of Ambisonic Signals via Magnitude Least Squares. InProceedings of the DAGA 2018 (Vol. 44, pp. 339-342).
Author
Leo McCormack
Date
14.04.2018
License
ISC

Definition in file ambi_bin.h.

Macro Definition Documentation

◆ AMBI_BIN_NUM_DECODING_METHODS

#define AMBI_BIN_NUM_DECODING_METHODS   ( 5 )

Number of decoding method options.

Definition at line 138 of file ambi_bin.h.

◆ AMBI_BIN_NUM_HRIR_PREPROC_OPTIONS

#define AMBI_BIN_NUM_HRIR_PREPROC_OPTIONS   ( 4 )

Number of HRIR pre-preprocessing options.

Definition at line 149 of file ambi_bin.h.

Enumeration Type Documentation

◆ AMBI_BIN_DECODING_METHODS

Available decoding methods for the ambi_bin example.

See saf_hoa_internal.h for a more indepth descriptions of the approaches.

Enumerator
DECODING_METHOD_LS 

Least-squares (LS) decoder.

DECODING_METHOD_LSDIFFEQ 

Least-squares (LS) decoder with diffuse-field spectral equalisation.

DECODING_METHOD_SPR 

Spatial resampling decoder (on the same lines as the virtual loudspeaker approach)

DECODING_METHOD_TA 

Time-alignment (TA)

DECODING_METHOD_MAGLS 

Magnitude least-squares decoder (MagLS)

Examples
ambi_bin.h.

Definition at line 126 of file ambi_bin.h.

◆ AMBI_BIN_PREPROC

Available HRIR pre-preprocessing options.

Enumerator
HRIR_PREPROC_OFF 

No pre-processing active.

HRIR_PREPROC_EQ 

Diffuse-field EQ (compensates CTF)

HRIR_PREPROC_PHASE 

Phase simplification based on ITD.

HRIR_PREPROC_ALL 

Diffuse-field EQ AND phase-simplification.

Examples
ambi_bin.h.

Definition at line 141 of file ambi_bin.h.

Function Documentation

◆ ambi_bin_create()

void ambi_bin_create ( void **const phAmbi)

Creates an instance of ambi_bin.

Parameters
[in]phAmbi(&) address of ambi_bin handle
Examples
ambi_bin.h.

Definition at line 50 of file ambi_bin.c.

◆ ambi_bin_destroy()

void ambi_bin_destroy ( void **const phAmbi)

Destroys an instance of ambi_bin.

Parameters
[in]phAmbi(&) address of ambi_bin handle
Examples
ambi_bin.h.

Definition at line 110 of file ambi_bin.c.

◆ ambi_bin_getChOrder()

int ambi_bin_getChOrder ( void *const hAmbi)

Returns the Ambisonic channel ordering convention currently being used to decode with, which should match the convention employed by the input signals (see CH_ORDER enum)

Examples
ambi_bin.h.

Definition at line 725 of file ambi_bin.c.

◆ ambi_bin_getCodecStatus()

CODEC_STATUS ambi_bin_getCodecStatus ( void *const hAmbi)

Returns current codec status, see CODEC_STATUS enum.

Examples
ambi_bin.h.

Definition at line 673 of file ambi_bin.c.

◆ ambi_bin_getDAWsamplerate()

int ambi_bin_getDAWsamplerate ( void *const hAmbi)

Returns the DAW/Host sample rate.

Examples
ambi_bin.h.

Definition at line 835 of file ambi_bin.c.

◆ ambi_bin_getDecodingMethod()

AMBI_BIN_DECODING_METHODS ambi_bin_getDecodingMethod ( void *const hAmbi)

Returns the currently selected decoding method (see AMBI_BIN_DECODING_METHODS enum)

Examples
ambi_bin.h.

Definition at line 709 of file ambi_bin.c.

◆ ambi_bin_getEnableDiffuseMatching()

int ambi_bin_getEnableDiffuseMatching ( void *const hAmbi)

Returns the flag value which dictates whether the diffuse covariance contraint is currently enabled ('0' disabled, '1' enabled).

Examples
ambi_bin.h.

Definition at line 743 of file ambi_bin.c.

◆ ambi_bin_getEnableMaxRE()

int ambi_bin_getEnableMaxRE ( void *const hAmbi)

Returns the flag value which dictates whether to enable/disable maxrE weighting ('0' disabled, '1' enabled).

Examples
ambi_bin.h.

Definition at line 737 of file ambi_bin.c.

◆ ambi_bin_getEnableRotation()

int ambi_bin_getEnableRotation ( void *const hAmbi)

Returns the flag value which dictates whether to enable/disable sound-field rotation ('0' disabled, '1' enabled).

Examples
ambi_bin.h.

Definition at line 766 of file ambi_bin.c.

◆ ambi_bin_getEnableTruncationEQ()

int ambi_bin_getEnableTruncationEQ ( void *const hAmbi)

Returns the flag value which dictates whether the truncation EQ is currently enabled ('0' disabled, '1' enabled).

Examples
ambi_bin.h.

Definition at line 749 of file ambi_bin.c.

◆ ambi_bin_getFlipPitch()

int ambi_bin_getFlipPitch ( void *const hAmbi)

Returns a flag as to whether to "flip" the sign of the current 'pitch' angle ('0' do not flip sign, '1' flip the sign)

Examples
ambi_bin.h.

Definition at line 796 of file ambi_bin.c.

◆ ambi_bin_getFlipRoll()

int ambi_bin_getFlipRoll ( void *const hAmbi)

Returns a flag as to whether to "flip" the sign of the current 'roll' angle ('0' do not flip sign, '1' flip the sign)

Examples
ambi_bin.h.

Definition at line 802 of file ambi_bin.c.

◆ ambi_bin_getFlipYaw()

int ambi_bin_getFlipYaw ( void *const hAmbi)

Returns a flag as to whether to "flip" the sign of the current 'yaw' angle ('0' do not flip sign, '1' flip the sign)

Examples
ambi_bin.h.

Definition at line 790 of file ambi_bin.c.

◆ ambi_bin_getFrameSize()

int ambi_bin_getFrameSize ( void )

Returns the processing framesize (i.e., number of samples processed with every _process() call )

Examples
ambi_bin.h.

Definition at line 668 of file ambi_bin.c.

◆ ambi_bin_getHRIRlength()

int ambi_bin_getHRIRlength ( void *const hAmbi)

Returns the length of HRIRs in time-domain samples.

Examples
ambi_bin.h.

Definition at line 821 of file ambi_bin.c.

◆ ambi_bin_getHRIRsamplerate()

int ambi_bin_getHRIRsamplerate ( void *const hAmbi)

Returns the HRIR sample rate.

Examples
ambi_bin.h.

Definition at line 828 of file ambi_bin.c.

◆ ambi_bin_getHRIRsPreProc()

AMBI_BIN_PREPROC ambi_bin_getHRIRsPreProc ( void *const hAmbi)

Returns HRIR pre-processing strategy.


(see AMBI_BIN_PREPROC enum)

Examples
ambi_bin.h.

Definition at line 697 of file ambi_bin.c.

◆ ambi_bin_getInputOrderPreset()

int ambi_bin_getInputOrderPreset ( void *const hAmbi)

Returns the decoding order.

If decoding order is higher than the input signal order, the extra required channels are filled with zeros. If the decoding order is lower than the input signal order, the number input signals is truncated accordingly.

Examples
ambi_bin.h.

Definition at line 703 of file ambi_bin.c.

◆ ambi_bin_getNDirs()

int ambi_bin_getNDirs ( void *const hAmbi)

Returns the number of directions in the currently used HRIR set.

Examples
ambi_bin.h.

Definition at line 814 of file ambi_bin.c.

◆ ambi_bin_getNormType()

int ambi_bin_getNormType ( void *const hAmbi)

Returns the Ambisonic normalisation convention currently being usedto decode with, which should match the convention employed by the input signals (see NORM_TYPES enum).

Examples
ambi_bin.h.

Definition at line 731 of file ambi_bin.c.

◆ ambi_bin_getNSHrequired()

int ambi_bin_getNSHrequired ( void *const hAmbi)

Returns the number of spherical harmonic signals required by the current decoding order: (current_order+1)^2.

Examples
ambi_bin.h.

Definition at line 760 of file ambi_bin.c.

◆ ambi_bin_getNumEars()

int ambi_bin_getNumEars ( void )

Returns the number of ears possessed by the average homo sapien (2)

Examples
ambi_bin.h.

Definition at line 755 of file ambi_bin.c.

◆ ambi_bin_getPitch()

float ambi_bin_getPitch ( void *const hAmbi)

Returns the 'pitch' rotation angle, in degrees.

Examples
ambi_bin.h.

Definition at line 778 of file ambi_bin.c.

◆ ambi_bin_getProcessingDelay()

int ambi_bin_getProcessingDelay ( void )

Returns the processing delay in samples (may be used for delay compensation features)

Examples
ambi_bin.h.

Definition at line 841 of file ambi_bin.c.

◆ ambi_bin_getProgressBar0_1()

float ambi_bin_getProgressBar0_1 ( void *const hAmbi)

(Optional) Returns current intialisation/processing progress, between 0..1

Examples
ambi_bin.h.

Definition at line 679 of file ambi_bin.c.

◆ ambi_bin_getProgressBarText()

void ambi_bin_getProgressBarText ( void *const hAmbi,
char * text )

(Optional) Returns current intialisation/processing progress text

Note
"text" string should be (at least) of length: PROGRESSBARTEXT_CHAR_LENGTH
Examples
ambi_bin.h.

Definition at line 685 of file ambi_bin.c.

◆ ambi_bin_getRoll()

float ambi_bin_getRoll ( void *const hAmbi)

Returns the 'roll' rotation angle, in degrees.

Examples
ambi_bin.h.

Definition at line 784 of file ambi_bin.c.

◆ ambi_bin_getRPYflag()

int ambi_bin_getRPYflag ( void *const hAmbi)

Returns a flag as to whether to use "yaw-pitch-roll" (0) or "roll-pitch-yaw" (1) rotation order.

Examples
ambi_bin.h.

Definition at line 808 of file ambi_bin.c.

◆ ambi_bin_getSofaFilePath()

char * ambi_bin_getSofaFilePath ( void *const hAmbi)

Returns the file path for a .sofa file.

Note
If the custom set fails to load correctly, ambi_bin will revert to the default set. Use ambi_bin_getUseDefaultHRIRsflag() to check if loading was successful. Also, note the .sofa file extension is included in the returned string.
Examples
ambi_bin.h.

Definition at line 715 of file ambi_bin.c.

◆ ambi_bin_getUseDefaultHRIRsflag()

int ambi_bin_getUseDefaultHRIRsflag ( void *const hAmbi)

Returns the value of a flag used to dictate whether the default HRIRs in the Spatial_Audio_Framework should be used (1), or a custom HRIR set loaded via a SOFA file (0).

Note
If the custom set fails to load correctly, ambi_bin will revert to the default set and this function will return '1'.
Examples
ambi_bin.h.

Definition at line 691 of file ambi_bin.c.

◆ ambi_bin_getYaw()

float ambi_bin_getYaw ( void *const hAmbi)

Returns the 'yaw' rotation angle, in degree.

Examples
ambi_bin.h.

Definition at line 772 of file ambi_bin.c.

◆ ambi_bin_init()

void ambi_bin_init ( void *const hAmbi,
int samplerate )

Initialises ambi_bin with default settings, and samplerate.

Warning
This should not be called while _process() is on-going!
Parameters
[in]hAmbiambi_bin handle
[in]sampleratehost samplerate.
Examples
ambi_bin.h.

Definition at line 148 of file ambi_bin.c.

◆ ambi_bin_initCodec()

void ambi_bin_initCodec ( void *const hAmbi)

Intialises the codec variables, based on current global/user parameters.

Note
This function is fully threadsafe. It can even be called periodically via a timer on one thread, while calling _process() on another thread. Since, if a set function is called (that warrants a re-init), then a flag is triggered internally and the next time this function is called, it will wait until the current process() function has completed before reinitialising the relevant parameters. If the _initCodec() takes longer than the time it takes for process() to be called again, then process() is simply bypassed until the codec is ready.
This function does nothing if no re-initialisations are required.
Parameters
[in]hAmbiambi_bin handle
Examples
ambi_bin.h.

Definition at line 168 of file ambi_bin.c.

◆ ambi_bin_process()

void ambi_bin_process ( void *const hAmbi,
const float *const * inputs,
float *const *const outputs,
int nInputs,
int nOutputs,
int nSamples )

Decodes input spherical harmonic signals to the binaural channels.

Parameters
[in]hAmbiambi_bin handle
[in]inputsInput channel buffers; 2-D array: nInputs x nSamples
[in]outputsOutput channel buffers; 2-D array: nOutputs x nSamples
[in]nInputsNumber of input channels
[in]nOutputsNumber of output channels
[in]nSamplesNumber of samples in 'inputs'/'output' matrices
Examples
ambi_bin.h.

Definition at line 402 of file ambi_bin.c.

◆ ambi_bin_refreshParams()

void ambi_bin_refreshParams ( void *const hAmbi)

Sets intialisation flags to 1, so as to re-initialise all settings/variables (as ambi_bin is currently configured), at next available opportunity.

Examples
ambi_bin.h.

Definition at line 505 of file ambi_bin.c.

◆ ambi_bin_setChOrder()

void ambi_bin_setChOrder ( void *const hAmbi,
int newOrder )

Sets the Ambisonic channel ordering convention to decode with, in order to match the convention employed by the input signals.

Examples
ambi_bin.h.

Definition at line 555 of file ambi_bin.c.

◆ ambi_bin_setDecodingMethod()

void ambi_bin_setDecodingMethod ( void *const hAmbi,
AMBI_BIN_DECODING_METHODS newMethod )

Sets the decoding method (see AMBI_BIN_DECODING_METHODS enum)

Examples
ambi_bin.h.

Definition at line 548 of file ambi_bin.c.

◆ ambi_bin_setEnableDiffuseMatching()

void ambi_bin_setEnableDiffuseMatching ( void *const hAmbi,
int newState )

Sets a flag to enable/disable (1 or 0) the diffuse-covariance constraint.

Examples
ambi_bin.h.

Definition at line 578 of file ambi_bin.c.

◆ ambi_bin_setEnableMaxRE()

void ambi_bin_setEnableMaxRE ( void *const hAmbi,
int newState )

Sets a flag to enable/disable the max_rE weighting.

Examples
ambi_bin.h.

Definition at line 569 of file ambi_bin.c.

◆ ambi_bin_setEnableRotation()

void ambi_bin_setEnableRotation ( void *const hAmbi,
int newState )

Sets the flag to enable/disable (1 or 0) sound-field rotation.

Examples
ambi_bin.h.

Definition at line 605 of file ambi_bin.c.

◆ ambi_bin_setEnableTruncationEQ()

void ambi_bin_setEnableTruncationEQ ( void *const hAmbi,
int newState )

Sets a flag to enable/disable (1 or 0) truncation EQ.

Examples
ambi_bin.h.

Definition at line 587 of file ambi_bin.c.

◆ ambi_bin_setFlipPitch()

void ambi_bin_setFlipPitch ( void *const hAmbi,
int newState )

Sets a flag as to whether to "flip" the sign of the current 'pitch' angle.

Examples
ambi_bin.h.

Definition at line 641 of file ambi_bin.c.

◆ ambi_bin_setFlipRoll()

void ambi_bin_setFlipRoll ( void *const hAmbi,
int newState )

Sets a flag as to whether to "flip" the sign of the current 'roll' angle.

Examples
ambi_bin.h.

Definition at line 650 of file ambi_bin.c.

◆ ambi_bin_setFlipYaw()

void ambi_bin_setFlipYaw ( void *const hAmbi,
int newState )

Sets a flag as to whether to "flip" the sign of the current 'yaw' angle.

Examples
ambi_bin.h.

Definition at line 632 of file ambi_bin.c.

◆ ambi_bin_setHRIRsPreProc()

void ambi_bin_setHRIRsPreProc ( void *const hAmbi,
AMBI_BIN_PREPROC newType )

Sets HRIR pre-processing strategy (see AMBI_BIN_PREPROC enum)

Examples
ambi_bin.h.

Definition at line 596 of file ambi_bin.c.

◆ ambi_bin_setInputOrderPreset()

void ambi_bin_setInputOrderPreset ( void *const hAmbi,
SH_ORDERS newPreset )

Sets the decoding order (see SH_ORDERS enum)

Note
If decoding order is higher than the input signal order, the extra required channels are filled with zeros. If the decoding order is lower than the input signal order, the number input signals is truncated accordingly.
Examples
ambi_bin.h.

Definition at line 534 of file ambi_bin.c.

◆ ambi_bin_setNormType()

void ambi_bin_setNormType ( void *const hAmbi,
int newType )

Sets the Ambisonic normalisation convention to decode with, in order to match with the convention employed by the input signals.

Examples
ambi_bin.h.

Definition at line 562 of file ambi_bin.c.

◆ ambi_bin_setPitch()

void ambi_bin_setPitch ( void *const hAmbi,
float newPitch )

Sets the 'pitch' rotation angle, in degrees.

Examples
ambi_bin.h.

Definition at line 618 of file ambi_bin.c.

◆ ambi_bin_setRoll()

void ambi_bin_setRoll ( void *const hAmbi,
float newRoll )

Sets the 'roll' rotation angle, in degrees.

Examples
ambi_bin.h.

Definition at line 625 of file ambi_bin.c.

◆ ambi_bin_setRPYflag()

void ambi_bin_setRPYflag ( void *const hAmbi,
int newState )

Sets a flag as to whether to use "yaw-pitch-roll" (0) or "roll-pitch-yaw" (1) rotation order.

Examples
ambi_bin.h.

Definition at line 659 of file ambi_bin.c.

◆ ambi_bin_setSofaFilePath()

void ambi_bin_setSofaFilePath ( void *const hAmbi,
const char * path )

Sets the file path for a .sofa file, in order to employ a custom HRIR set for the decoding.

Note
If the custom set failes to load correctly, hcompass will revert to the defualt set. Use ambi_bin_getUseDefaultHRIRsflag() to check if loading was successful.
Parameters
[in]hAmbiambi_bin handle
[in]pathFile path to .sofa file (WITH file extension)
Examples
ambi_bin.h.

Definition at line 522 of file ambi_bin.c.

◆ ambi_bin_setUseDefaultHRIRsflag()

void ambi_bin_setUseDefaultHRIRsflag ( void *const hAmbi,
int newState )

Sets flag to dictate whether the default HRIRs in the Spatial_Audio_Framework should be used, or a custom HRIR set loaded via a SOFA file.

Note
If the custom set failes to load correctly, ambi_bin will revert to the default set. Use ambi_bin_getUseDefaultHRIRsflag() to check if loading was successful.
Parameters
[in]hAmbiambi_bin handle
[in]newState'0' use custom HRIR set, '1' use default HRIR set
Examples
ambi_bin.h.

Definition at line 512 of file ambi_bin.c.

◆ ambi_bin_setYaw()

void ambi_bin_setYaw ( void *const hAmbi,
float newYaw_deg )

Sets the 'yaw' rotation angle, in degrees.

Examples
ambi_bin.h.

Definition at line 611 of file ambi_bin.c.