27#ifndef SAF_TEST_SOFA_FILE_PATH
28# define SAF_TEST_SOFA_FILE_PATH "/Users/mccorml1/Documents/FABIAN_HRTF_DATABASE_V1/1 HRIRs/SOFA/FABIAN_HRIR_measured_HATO_20.sofa"
31#ifdef SAF_ENABLE_SOFA_READER_MODULE
36 for(
int i=0; i<1 ; i++){
45 struct MYSOFA_HRTF *hrtf;
46 for(
int i=0; i<1 ; i++){
47 hrtf = mysofa_load(SAF_TEST_SOFA_FILE_PATH, &err);
53#ifdef SAF_ENABLE_NETCDF
57 struct MYSOFA_HRTF *hrtf;
61 hrtf = mysofa_load(SAF_TEST_SOFA_FILE_PATH, &err);
66 for(
unsigned int i=0; i<hrtf->M * hrtf->R * hrtf->N; i++)
67 TEST_ASSERT_TRUE(fabsf(sofa.
DataIR[i]- hrtf->DataIR.values[i])<0.000001f);
68 for(
unsigned int i=0; i<hrtf->M * hrtf->C; i++)
69 TEST_ASSERT_TRUE(fabsf(sofa.
SourcePosition[i]- hrtf->SourcePosition.values[i])<0.000001f);
70 for(
unsigned int i=0; i<hrtf->M * hrtf->C; i++)
71 TEST_ASSERT_TRUE(fabsf(sofa.
SourcePosition[i]- hrtf->SourcePosition.values[i])<0.000001f);
72 for(
unsigned int i=0; i<hrtf->_I * hrtf->R; i++)
73 TEST_ASSERT_TRUE(fabsf(sofa.
DataDelay[i]- hrtf->DataDelay.values[i])<0.000001f);
void saf_sofa_close(saf_sofa_container *c)
Frees all SOFA data in a sofa_container.
SAF_SOFA_ERROR_CODES saf_sofa_open(saf_sofa_container *h, char *sofa_filepath, SAF_SOFA_READER_OPTIONS option)
Fills a 'sofa_container' with data found in a SOFA file (GeneralFIR or SimpleFreeFieldHRIR),...
SAF_SOFA_ERROR_CODES
SOFA loader error codes.
@ SAF_SOFA_READER_OPTION_DEFAULT
The default option is SAF_SOFA_READER_OPTION_LIBMYSOFA.
@ SAF_SOFA_READER_OPTION_NETCDF
If SAF_ENABLE_NETCDF is defined, then an alternative SOFA reader may be used.
@ SAF_SOFA_OK
None of the error checks failed.
Unit test program for the Spatial_Audio_Framework.
SOFA container struct comprising all possible data that can be extracted from SOFA 1....
float * DataDelay
Delay in samples; nReceivers x 1.
float * SourcePosition
Source positions (refer to SourcePositionType & SourcePositionUnits for the convention and units); FL...
float * DataIR
The impulse response (IR) Data; FLAT:nSources x nReceivers x DataLengthIR.
void test__mysofa_load(void)
Testing the dependency free mysofa SOFA reader.
void test__saf_sofa_open(void)
Testing the SAF SOFA reader that uses the netcdf library.
void test__sofa_comparison(void)
Testing that the two SOFA readers produce the same results.