File: mit_hrtf_lib.h

package info (click to toggle)
libspatialaudio 0.3.0%2Bgit20180730%2Bdfsg1-2.1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 468 kB
  • sloc: cpp: 2,293; ansic: 1,247; makefile: 5
file content (79 lines) | stat: -rw-r--r-- 3,446 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*############################################################################*/
/*#                                                                          #*/
/*#  MIT HRTF C Library                                                      #*/
/*#  Copyright © 2007 Aristotel Digenis                                      #*/
/*#                                                                          #*/
/*#  Filename:  mit_hrtf_lib.h                                               #*/
/*#  Version:   0.1                                                          #*/
/*#  Date:      04/05/2007                                                   #*/
/*#  Author(s): Aristotel Digenis                                            #*/
/*#  Credit:    Bill Gardner and Keith Martin                                #*/
/*#  Licence:   MIT                                                          #*/
/*#                                                                          #*/
/*############################################################################*/


#ifndef _MIT_HRTF_LIB_H_
#define _MIT_HRTF_LIB_H_

#ifdef __cplusplus
extern "C" {
#endif

#include "mit_hrtf_filter.h"



/**
    Checks if an HRTF set is available for the specified settings.

    "azimuth" is in the range of [-180, 180] degrees, where position 0 is the
    centre in front of the listener, negative values are to the left of the
    listener, and positive values are to the right of the front centre.

    "elevation" is in the range of [-90, 90] degrees, where position 0 is the
    centre in front of the listener, negative values are below the listener,
    and positive values are above the listener.

    "samplerate" can be one of the following: 44100, 48000, 88200, 96000

    Returns the number of taps needed for the each channel of the available
    set. Returns 0 if the requested HRTF set is not available.
*/
unsigned int mit_hrtf_availability(int azimuth, int elevation, unsigned int samplerate);



/**
    Copies HRTF taps to given buffers, for specified HRTF set.

    "pAzimuth" is in the range of [-180, 180] degrees, where position 0 is the
    centre in front of the listener, negative values are to the left of the
    listener, and positive values are to the right of the front centre. The
    variable is a pointer, so that once the function returns, the actual
    azimuth position used is written to that pointed variable.

    "pElevation" is in the range of [-90, 90] degrees, where position 0 is the
    centre in front of the listener, negative values are below the listener,
    and positive values are above the listener. The variable is a pointer, so
    that once the function returns, the actual azimuth position used is
    written to that pointed variable.

    "samplerate" can be one of the following: 44100, 48000, 88200, 96000

    "psLeft" and "psRight" are pointers to buffers allocated (and later
    deallocated) by the user based on the return value of the
    "mit_hrtf_availability" function.

    Returns the number of taps copied to each of the "psLeft" and "psRight"
    buffers. Returns 0 if the requested HRTF set is not available or if there
    was an error.
*/
unsigned int mit_hrtf_get(int* pAzimuth, int* pElevation, unsigned int samplerate, short* psLeft, short* psRight);


#ifdef __cplusplus
} 
#endif

#endif // _MIT_HRTF_LIB_H_