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++){
46 struct MYSOFA_HRTF *hrtf;
47 for(
int i=0; i<1 ; i++){
48 hrtf = mysofa_load(SAF_TEST_SOFA_FILE_PATH, &err);
54#ifdef SAF_ENABLE_NETCDF
58 struct MYSOFA_HRTF *hrtf;
62 hrtf = mysofa_load(SAF_TEST_SOFA_FILE_PATH, &err);
67 for(
unsigned int i=0; i<hrtf->M * hrtf->R * hrtf->N; i++)
68 TEST_ASSERT_TRUE(fabsf(sofa.
DataIR[i]- hrtf->DataIR.values[i])<0.000001f);
69 for(
unsigned int i=0; i<hrtf->M * hrtf->C; i++)
70 TEST_ASSERT_TRUE(fabsf(sofa.
SourcePosition[i]- hrtf->SourcePosition.values[i])<0.000001f);
71 for(
unsigned int i=0; i<hrtf->M * hrtf->C; i++)
72 TEST_ASSERT_TRUE(fabsf(sofa.
SourcePosition[i]- hrtf->SourcePosition.values[i])<0.000001f);
73 for(
unsigned int i=0; i<hrtf->_I * hrtf->R; i++)
74 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.
@ SAF_SOFA_ERROR_FORMAT_UNEXPECTED
The data-type of the SOFA data was not as expected.
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.