From 38e7bd53590a6726f7dc5cc70ab92603aa8e2117 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Wed, 12 Sep 2012 05:11:53 -0700 Subject: Properly scale the HRTF delays when writing them --- utils/makehrtf.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'utils/makehrtf.c') diff --git a/utils/makehrtf.c b/utils/makehrtf.c index 5a3f7d1b..f6b16889 100644 --- a/utils/makehrtf.c +++ b/utils/makehrtf.c @@ -1777,8 +1777,7 @@ static int StoreMhr (const HrirDataT * hData, const char * filename) { } } for (j = 0; j < hData -> mIrCount; j ++) { -// v = (int) fmin (round (44100.0 * hData -> mHrtds [j]), MAX_HRTD); - v = (int) fmin (hData -> mHrtds [j], MAX_HRTD); + v = (int) fmin (round (hData -> mIrRate * hData -> mHrtds [j]), MAX_HRTD); if (! WriteBin4 (BO_LITTLE, 1, (uint4) v, fp, filename)) return (0); } @@ -1844,7 +1843,7 @@ static int StoreTable (const HrirDataT * hData, const char * filename) { if (! WriteAscii (text, fp, filename)) return (0); for (j = 0; j < hData -> mIrCount; j ++) { - v = (int) fmin (round (44100.0 * hData -> mHrtds [j]), MAX_HRTD); + v = (int) fmin (round (hData -> mIrRate * hData -> mHrtds [j]), MAX_HRTD); snprintf (text, 128, "%d, ", v); if (! WriteAscii (text, fp, filename)) return (0); -- cgit v1.2.3