aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-05-01 13:59:44 -0700
committerChris Robinson <[email protected]>2011-05-01 13:59:44 -0700
commit56d9418119045d536efa3f552af6e13d9353ada9 (patch)
treea1688ab2434cd8f3c1bfdb2c928117b50c357b08 /OpenAL32
parent0109104027ec4de46c236f6520cf00d89dd980ad (diff)
Add an HRTF filter for mono sources
The data is based on the KEMAR HRTF data provided by MIT, which can be found at <http://sound.media.mit.edu/resources/KEMAR.html>. The compact measurements were used. See hrtf_tables.inc for more information. The filter is only available for stereo output, using a 44100hz playback rate. Note also that it currently only applies to mono sounds, and the cf_level and head_dampen config options are ignored while it is active.
Diffstat (limited to 'OpenAL32')
-rw-r--r--OpenAL32/Include/alMain.h1
-rw-r--r--OpenAL32/alSource.c4
2 files changed, 5 insertions, 0 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
index 6c18a387..9cf2b1a4 100644
--- a/OpenAL32/Include/alMain.h
+++ b/OpenAL32/Include/alMain.h
@@ -587,6 +587,7 @@ ALboolean IsValidChannels(ALenum type);
#define HRTF_BITS (7)
#define HRTF_LENGTH (1<<HRTF_BITS)
#define HRTF_LENGTH_MASK (HRTF_LENGTH-1)
+void GetHrtfCoeffs(ALfloat azimuth, ALfloat angle, const ALshort **left, const ALshort **right);
void al_print(const char *fname, unsigned int line, const char *fmt, ...)
PRINTF_STYLE(3,4);
diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c
index ed69af34..14beb85f 100644
--- a/OpenAL32/alSource.c
+++ b/OpenAL32/alSource.c
@@ -1348,6 +1348,10 @@ AL_API ALvoid AL_APIENTRY alSourcePlayv(ALsizei n, const ALuint *sources)
Source->BuffersPlayed = 0;
Source->Buffer = Source->queue->buffer;
+
+ for(j = 0;j < HRTF_LENGTH;j++)
+ Source->HrtfHistory[j] = 0.0f;
+ Source->HrtfOffset = 0;
}
else
Source->state = AL_PLAYING;