35#ifndef __SAF_SOFA_READER_H_INCLUDED__
36#define __SAF_SOFA_READER_H_INCLUDED__
42#ifdef SAF_ENABLE_SOFA_READER_MODULE
44#include "libmysofa/mysofa.h"
86typedef struct _saf_sofa_container{
void saf_sofa_close(saf_sofa_container *hSOFA)
Frees all SOFA data in a sofa_container.
SAF_SOFA_READER_OPTIONS
SOFA file reader options.
SAF_SOFA_ERROR_CODES saf_sofa_open(saf_sofa_container *hSOFA, 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_READER_OPTION_LIBMYSOFA
This option uses the libmysofa library to load SOFA files, which is adopted from: https://github....
@ SAF_SOFA_ERROR_INVALID_FILE_OR_FILE_PATH
Not a SOFA file, or no such file was found in the specified location.
@ SAF_SOFA_ERROR_NETCDF_IN_USE
NetCDF is not thread safe!
@ 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.
@ SAF_SOFA_ERROR_DIMENSIONS_UNEXPECTED
Dimensions of the SOFA data were not as expected.
SOFA container struct comprising all possible data that can be extracted from SOFA 1....
float * DataDelay
Delay in samples; nReceivers x 1.
char * Organisation
Organisation reponsible for the file.
int DataLengthIR
Length of the IRs, in samples.
char * Origin
Where this file came from.
char * SOFAConventionsVersion
SOFA convention number.
int nSources
Number of source/measurement positions.
char * RoomType
Room type (free field etc.)
char * DataSamplingRateUnits
{'hertz'}
char * EmitterPositionUnits
{'degree, degree, metre'|'metre'}
char * ReceiverPositionUnits
{'degree, degree, metre'|'metre'}
float * SourcePosition
Source positions (refer to SourcePositionType & SourcePositionUnits for the convention and units); FL...
int nListeners
Number of listener positions.
char * DateCreated
Date file was created.
char * References
References.
float * ReceiverPosition
Receiver positions (refer to ReceiverPositionType & ReceiverPositionUnits for the convention and unit...
char * SourcePositionUnits
{'degree, degree, metre'|'metre'}
char * Conventions
{'SOFA'}
char * DataType
{'FIR'|'TF'}
char * SourcePositionType
{'cartesian'|'spherical'}
char * ReceiverPositionType
{'cartesian'|'spherical'}
char * EmitterPositionType
{'cartesian'|'spherical'}
char * ListenerPositionType
{'cartesian'|'spherical'}
char * SOFAConventions
{'GeneralFIR'|'GeneralTF'| 'SimpleFreeFieldHRIR'}
char * ListenerPositionUnits
{'degree, degree, metre'|'metre'}
float * EmitterPosition
Positions of acoustic excitation used for the measurement (refer to EmitterPositionType & EmitterPosi...
char * Title
Title of file.
char * Comment
File comments.
char * APIVersion
API version.
float * ListenerPosition
Listener position (The object incorporating all receivers; refer to ListenerPositionType & ListenerPo...
char * ApplicationVersion
Ver.
char * DatabaseName
Name of database this file belongs to.
float * ListenerView
Vector pointing forwards from the listener position (Cartesian); 3 x 1.
float DataSamplingRate
Sampling rate used to measure the IRs.
char * History
History information.
int nEmitters
Number of emitter positions.
char * Version
Version number.
char * ApplicationName
Name of Application that created file.
char * ListenerViewUnits
{'degree, degree, metre'|'metre'}
void * hLMSOFA
libmysofa handle
char * ListenerShortName
Name of the listener/dummyhead/mic etc.
int nReceivers
Number of ears/number of mics etc.
char * DateModified
Date file was modified.
char * ListenerViewType
{'cartesian'|'spherical'}
float * ListenerUp
Vector pointing upwards from the listener position (Cartesian); 1 x 3 or FLAT: nListeners x 3
char * AuthorContact
Contact information.
char * License
License under which file is provided.
float * DataIR
The impulse response (IR) Data; FLAT:nSources x nReceivers x DataLengthIR.