2014-02-24 05:11:01 +00:00
|
|
|
#ifndef ALC_HRTF_H
|
|
|
|
#define ALC_HRTF_H
|
|
|
|
|
|
|
|
#include "AL/al.h"
|
|
|
|
#include "AL/alc.h"
|
|
|
|
|
2015-09-20 11:10:21 +00:00
|
|
|
#include "alstring.h"
|
|
|
|
|
2016-07-07 17:26:42 +00:00
|
|
|
|
|
|
|
struct Hrtf {
|
|
|
|
ALuint sampleRate;
|
|
|
|
ALuint irSize;
|
|
|
|
ALubyte evCount;
|
|
|
|
|
|
|
|
const ALubyte *azCount;
|
|
|
|
const ALushort *evOffset;
|
|
|
|
const ALshort *coeffs;
|
|
|
|
const ALubyte *delays;
|
|
|
|
|
|
|
|
const char *filename;
|
|
|
|
struct Hrtf *next;
|
|
|
|
};
|
2014-02-24 05:11:01 +00:00
|
|
|
|
2015-10-06 07:23:11 +00:00
|
|
|
typedef struct HrtfEntry {
|
|
|
|
al_string name;
|
2015-10-06 11:01:53 +00:00
|
|
|
|
|
|
|
const struct Hrtf *hrtf;
|
2015-10-06 07:23:11 +00:00
|
|
|
} HrtfEntry;
|
|
|
|
TYPEDEF_VECTOR(HrtfEntry, vector_HrtfEntry)
|
|
|
|
|
2014-02-24 05:11:01 +00:00
|
|
|
#define HRIR_BITS (7)
|
|
|
|
#define HRIR_LENGTH (1<<HRIR_BITS)
|
|
|
|
#define HRIR_MASK (HRIR_LENGTH-1)
|
|
|
|
#define HRTFDELAY_BITS (20)
|
|
|
|
#define HRTFDELAY_FRACONE (1<<HRTFDELAY_BITS)
|
|
|
|
#define HRTFDELAY_MASK (HRTFDELAY_FRACONE-1)
|
|
|
|
|
2015-10-06 13:48:53 +00:00
|
|
|
void FreeHrtfs(void);
|
|
|
|
|
2015-10-06 07:23:11 +00:00
|
|
|
vector_HrtfEntry EnumerateHrtf(const_al_string devname);
|
|
|
|
void FreeHrtfList(vector_HrtfEntry *list);
|
|
|
|
|
2016-04-25 04:42:59 +00:00
|
|
|
void GetLerpedHrtfCoeffs(const struct Hrtf *Hrtf, ALfloat elevation, ALfloat azimuth, ALfloat spread, ALfloat gain, ALfloat (*coeffs)[2], ALuint *delays);
|
2014-02-24 05:11:01 +00:00
|
|
|
|
|
|
|
#endif /* ALC_HRTF_H */
|