f4cdecebcf
At 0 distance from the listener, the sound is omni-directional. As the source and listener become 'radius' units apart, the sound becomes more directional. With HRTF, an omni-directional sound is handled using 0-delay, pass-through filter coefficients, which is blended with the real delay and coefficients as needed to become more directional.
29 lines
1.1 KiB
C
29 lines
1.1 KiB
C
#ifndef ALC_HRTF_H
|
|
#define ALC_HRTF_H
|
|
|
|
#include "AL/al.h"
|
|
#include "AL/alc.h"
|
|
|
|
enum DevFmtChannels;
|
|
|
|
struct Hrtf;
|
|
|
|
#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)
|
|
|
|
const struct Hrtf *GetHrtf(enum DevFmtChannels chans, ALCuint srate);
|
|
ALCboolean FindHrtfFormat(enum DevFmtChannels *chans, ALCuint *srate);
|
|
|
|
void FreeHrtfs(void);
|
|
|
|
ALuint GetHrtfIrSize(const struct Hrtf *Hrtf);
|
|
ALfloat CalcHrtfDelta(ALfloat oldGain, ALfloat newGain, const ALfloat olddir[3], const ALfloat newdir[3]);
|
|
void GetLerpedHrtfCoeffs(const struct Hrtf *Hrtf, ALfloat elevation, ALfloat azimuth, ALfloat dirfact, ALfloat gain, ALfloat (*coeffs)[2], ALuint *delays);
|
|
ALuint GetMovingHrtfCoeffs(const struct Hrtf *Hrtf, ALfloat elevation, ALfloat azimuth, ALfloat dirfact, ALfloat gain, ALfloat delta, ALint counter, ALfloat (*coeffs)[2], ALuint *delays, ALfloat (*coeffStep)[2], ALint *delayStep);
|
|
|
|
#endif /* ALC_HRTF_H */
|