SAF
Loading...
Searching...
No Matches
binauraliser_nf.h
Go to the documentation of this file.
1/*
2 * Copyright 2022 Michael McCrea, Leo McCormack
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10 * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14 * PERFORMANCE OF THIS SOFTWARE.
15 */
16
58#ifndef __BINAURALISER_NF_H_INCLUDED__
59#define __BINAURALISER_NF_H_INCLUDED__
60
61#include <binauraliser.h>
62
63#ifdef __cplusplus
64extern "C" {
65#endif /* __cplusplus */
66
67/* ========================================================================== */
68/* Main Functions */
69/* ========================================================================== */
70
76void binauraliserNF_create(void** const phBin);
77
83void binauraliserNF_destroy(void** const phBin);
84
93void binauraliserNF_init(void* const hBin,
94 int samplerate);
95
111/* See the source definition for a note on redundancy with binauraliser_initCodec. */
112void binauraliserNF_initCodec(void* const hBin);
113
124void binauraliserNF_process(void* const hBin,
125 const float *const * inputs,
126 float* const* outputs,
127 int nInputs,
128 int nOutputs,
129 int nSamples);
130
135void binauraliserNF_processFD(void* const hBin,
136 const float *const * inputs,
137 float* const* outputs,
138 int nInputs,
139 int nOutputs,
140 int nSamples);
141
142
143/* ========================================================================== */
144/* Set Functions */
145/* ========================================================================== */
146
154void binauraliserNF_setSourceDist_m(void* const hBin,
155 int index,
156 float newDist_m);
157
163void binauraliserNF_setInputConfigPreset(void* const hBin,
164 int newPresetID);
165
166
167/* ========================================================================== */
168/* Get Functions */
169/* ========================================================================== */
170
177float binauraliserNF_getSourceDist_m(void* const hBin, int index);
178
183float binauraliserNF_getFarfieldThresh_m(void* const hBin);
184
189float binauraliserNF_getFarfieldHeadroom(void* const hBin);
190
194float binauraliserNF_getNearfieldLimit_m(void* const hBin);
195
196#ifdef __cplusplus
197} /* extern "C" { */
198#endif /* __cplusplus */
199
200#endif /* __BINAURALISER_NF_H_INCLUDED__ */
Convolves input audio (up to 64 channels) with interpolated HRTFs in the time-frequency domain.
float binauraliserNF_getNearfieldLimit_m(void *const hBin)
Returns the minimum distance possible for near field filter, in METERS.
void binauraliserNF_processFD(void *const hBin, const float *const *inputs, float *const *outputs, int nInputs, int nOutputs, int nSamples)
Alternate version of binauraliserNF_process() that performs frequency-domain DVF filtering.
void binauraliserNF_init(void *const hBin, int samplerate)
Initialises an instance of binauraliser with default settings.
float binauraliserNF_getSourceDist_m(void *const hBin, int index)
Returns the source elevation for a given index, in METERS.
void binauraliserNF_create(void **const phBin)
Creates an instance of the binauraliser.
void binauraliserNF_destroy(void **const phBin)
Destroys an instance of the binauraliser.
void binauraliserNF_setInputConfigPreset(void *const hBin, int newPresetID)
Loads an input preset (see SOURCE_CONFIG_PRESETS enum)
float binauraliserNF_getFarfieldThresh_m(void *const hBin)
Returns the distance considered to be the far field (beyond which no near field filtering is applied)...
void binauraliserNF_setSourceDist_m(void *const hBin, int index, float newDist_m)
Sets the panning distance for a specific channel index, in METERS.
float binauraliserNF_getFarfieldHeadroom(void *const hBin)
Returns the scaling factor to give the far field threshold headroom (useful for UI range limits)
void binauraliserNF_initCodec(void *const hBin)
Intialises the codec variables, based on current global/user parameters.
void binauraliserNF_process(void *const hBin, const float *const *inputs, float *const *outputs, int nInputs, int nOutputs, int nSamples)
Binauralises the input signals at the user specified directions.