hrtf.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #ifndef ALC_HRTF_H
  2. #define ALC_HRTF_H
  3. #include "AL/al.h"
  4. #include "AL/alc.h"
  5. #include "alstring.h"
  6. enum DevFmtChannels;
  7. struct Hrtf;
  8. typedef struct HrtfEntry {
  9. al_string name;
  10. al_string filename;
  11. const struct Hrtf *hrtf;
  12. } HrtfEntry;
  13. TYPEDEF_VECTOR(HrtfEntry, vector_HrtfEntry)
  14. #define HRIR_BITS (7)
  15. #define HRIR_LENGTH (1<<HRIR_BITS)
  16. #define HRIR_MASK (HRIR_LENGTH-1)
  17. #define HRTFDELAY_BITS (20)
  18. #define HRTFDELAY_FRACONE (1<<HRTFDELAY_BITS)
  19. #define HRTFDELAY_MASK (HRTFDELAY_FRACONE-1)
  20. void FreeHrtfs(void);
  21. vector_HrtfEntry EnumerateHrtf(const_al_string devname);
  22. void FreeHrtfList(vector_HrtfEntry *list);
  23. ALuint GetHrtfSampleRate(const struct Hrtf *Hrtf);
  24. ALuint GetHrtfIrSize(const struct Hrtf *Hrtf);
  25. void GetLerpedHrtfCoeffs(const struct Hrtf *Hrtf, ALfloat elevation, ALfloat azimuth, ALfloat dirfact, ALfloat gain, ALfloat (*coeffs)[2], ALuint *delays);
  26. 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);
  27. void GetBFormatHrtfCoeffs(const struct Hrtf *Hrtf, const ALuint num_chans, ALfloat (**coeffs_list)[2], ALuint **delay_list);
  28. #endif /* ALC_HRTF_H */