2 * OpenAL cross platform audio library
3 * Copyright (C) 2011 by Chris Robinson
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 * Or go to http://www.gnu.org/copyleft/lgpl.html
36 /* Current data set limits defined by the makehrtf utility. */
37 #define MIN_IR_SIZE (8)
38 #define MAX_IR_SIZE (128)
39 #define MOD_IR_SIZE (8)
41 #define MIN_EV_COUNT (5)
42 #define MAX_EV_COUNT (128)
44 #define MIN_AZ_COUNT (1)
45 #define MAX_AZ_COUNT (128)
52 const ALubyte
*azCount
;
53 const ALushort
*evOffset
;
54 const ALshort
*coeffs
;
55 const ALubyte
*delays
;
61 static const ALchar magicMarker00
[8] = "MinPHR00";
62 static const ALchar magicMarker01
[8] = "MinPHR01";
64 /* First value for pass-through coefficients (remaining are 0), used for omni-
65 * directional sounds. */
66 static const ALfloat PassthruCoeff
= 32767.0f
* 0.707106781187f
/*sqrt(0.5)*/;
68 static struct Hrtf
*LoadedHrtfs
= NULL
;
70 /* Calculate the elevation indices given the polar elevation in radians.
71 * This will return two indices between 0 and (evcount - 1) and an
72 * interpolation factor between 0.0 and 1.0.
74 static void CalcEvIndices(ALuint evcount
, ALfloat ev
, ALuint
*evidx
, ALfloat
*evmu
)
76 ev
= (F_PI_2
+ ev
) * (evcount
-1) / F_PI
;
77 evidx
[0] = fastf2u(ev
);
78 evidx
[1] = minu(evidx
[0] + 1, evcount
-1);
79 *evmu
= ev
- evidx
[0];
82 /* Calculate the azimuth indices given the polar azimuth in radians. This
83 * will return two indices between 0 and (azcount - 1) and an interpolation
84 * factor between 0.0 and 1.0.
86 static void CalcAzIndices(ALuint azcount
, ALfloat az
, ALuint
*azidx
, ALfloat
*azmu
)
88 az
= (F_TAU
+ az
) * azcount
/ F_TAU
;
89 azidx
[0] = fastf2u(az
) % azcount
;
90 azidx
[1] = (azidx
[0] + 1) % azcount
;
91 *azmu
= az
- floorf(az
);
94 /* Calculates static HRIR coefficients and delays for the given polar
95 * elevation and azimuth in radians. Linear interpolation is used to
96 * increase the apparent resolution of the HRIR data set. The coefficients
97 * are also normalized and attenuated by the specified gain.
99 void GetLerpedHrtfCoeffs(const struct Hrtf
*Hrtf
, ALfloat elevation
, ALfloat azimuth
, ALfloat spread
, ALfloat gain
, ALfloat (*coeffs
)[2], ALuint
*delays
)
101 ALuint evidx
[2], lidx
[4], ridx
[4];
102 ALfloat mu
[3], blend
[4];
106 dirfact
= 1.0f
- (spread
/ F_TAU
);
108 /* Claculate elevation indices and interpolation factor. */
109 CalcEvIndices(Hrtf
->evCount
, elevation
, evidx
, &mu
[2]);
113 ALuint azcount
= Hrtf
->azCount
[evidx
[i
]];
114 ALuint evoffset
= Hrtf
->evOffset
[evidx
[i
]];
117 /* Calculate azimuth indices and interpolation factor for this elevation. */
118 CalcAzIndices(azcount
, azimuth
, azidx
, &mu
[i
]);
120 /* Calculate a set of linear HRIR indices for left and right channels. */
121 lidx
[i
*2 + 0] = evoffset
+ azidx
[0];
122 lidx
[i
*2 + 1] = evoffset
+ azidx
[1];
123 ridx
[i
*2 + 0] = evoffset
+ ((azcount
-azidx
[0]) % azcount
);
124 ridx
[i
*2 + 1] = evoffset
+ ((azcount
-azidx
[1]) % azcount
);
127 /* Calculate 4 blending weights for 2D bilinear interpolation. */
128 blend
[0] = (1.0f
-mu
[0]) * (1.0f
-mu
[2]);
129 blend
[1] = ( mu
[0]) * (1.0f
-mu
[2]);
130 blend
[2] = (1.0f
-mu
[1]) * ( mu
[2]);
131 blend
[3] = ( mu
[1]) * ( mu
[2]);
133 /* Calculate the HRIR delays using linear interpolation. */
134 delays
[0] = fastf2u((Hrtf
->delays
[lidx
[0]]*blend
[0] + Hrtf
->delays
[lidx
[1]]*blend
[1] +
135 Hrtf
->delays
[lidx
[2]]*blend
[2] + Hrtf
->delays
[lidx
[3]]*blend
[3]) *
136 dirfact
+ 0.5f
) << HRTFDELAY_BITS
;
137 delays
[1] = fastf2u((Hrtf
->delays
[ridx
[0]]*blend
[0] + Hrtf
->delays
[ridx
[1]]*blend
[1] +
138 Hrtf
->delays
[ridx
[2]]*blend
[2] + Hrtf
->delays
[ridx
[3]]*blend
[3]) *
139 dirfact
+ 0.5f
) << HRTFDELAY_BITS
;
141 /* Calculate the sample offsets for the HRIR indices. */
142 lidx
[0] *= Hrtf
->irSize
;
143 lidx
[1] *= Hrtf
->irSize
;
144 lidx
[2] *= Hrtf
->irSize
;
145 lidx
[3] *= Hrtf
->irSize
;
146 ridx
[0] *= Hrtf
->irSize
;
147 ridx
[1] *= Hrtf
->irSize
;
148 ridx
[2] *= Hrtf
->irSize
;
149 ridx
[3] *= Hrtf
->irSize
;
151 /* Calculate the normalized and attenuated HRIR coefficients using linear
152 * interpolation when there is enough gain to warrant it. Zero the
153 * coefficients if gain is too low.
160 c
= (Hrtf
->coeffs
[lidx
[0]+i
]*blend
[0] + Hrtf
->coeffs
[lidx
[1]+i
]*blend
[1] +
161 Hrtf
->coeffs
[lidx
[2]+i
]*blend
[2] + Hrtf
->coeffs
[lidx
[3]+i
]*blend
[3]);
162 coeffs
[i
][0] = lerp(PassthruCoeff
, c
, dirfact
) * gain
* (1.0f
/32767.0f
);
163 c
= (Hrtf
->coeffs
[ridx
[0]+i
]*blend
[0] + Hrtf
->coeffs
[ridx
[1]+i
]*blend
[1] +
164 Hrtf
->coeffs
[ridx
[2]+i
]*blend
[2] + Hrtf
->coeffs
[ridx
[3]+i
]*blend
[3]);
165 coeffs
[i
][1] = lerp(PassthruCoeff
, c
, dirfact
) * gain
* (1.0f
/32767.0f
);
167 for(i
= 1;i
< Hrtf
->irSize
;i
++)
169 c
= (Hrtf
->coeffs
[lidx
[0]+i
]*blend
[0] + Hrtf
->coeffs
[lidx
[1]+i
]*blend
[1] +
170 Hrtf
->coeffs
[lidx
[2]+i
]*blend
[2] + Hrtf
->coeffs
[lidx
[3]+i
]*blend
[3]);
171 coeffs
[i
][0] = lerp(0.0f
, c
, dirfact
) * gain
* (1.0f
/32767.0f
);
172 c
= (Hrtf
->coeffs
[ridx
[0]+i
]*blend
[0] + Hrtf
->coeffs
[ridx
[1]+i
]*blend
[1] +
173 Hrtf
->coeffs
[ridx
[2]+i
]*blend
[2] + Hrtf
->coeffs
[ridx
[3]+i
]*blend
[3]);
174 coeffs
[i
][1] = lerp(0.0f
, c
, dirfact
) * gain
* (1.0f
/32767.0f
);
179 for(i
= 0;i
< Hrtf
->irSize
;i
++)
188 static struct Hrtf
*LoadHrtf00(FILE *f
, const_al_string filename
)
190 const ALubyte maxDelay
= HRTF_HISTORY_LENGTH
-1;
191 struct Hrtf
*Hrtf
= NULL
;
192 ALboolean failed
= AL_FALSE
;
193 ALuint rate
= 0, irCount
= 0;
196 ALubyte
*azCount
= NULL
;
197 ALushort
*evOffset
= NULL
;
198 ALshort
*coeffs
= NULL
;
199 ALubyte
*delays
= NULL
;
204 rate
|= fgetc(f
)<<16;
205 rate
|= fgetc(f
)<<24;
208 irCount
|= fgetc(f
)<<8;
211 irSize
|= fgetc(f
)<<8;
215 if(irSize
< MIN_IR_SIZE
|| irSize
> MAX_IR_SIZE
|| (irSize
%MOD_IR_SIZE
))
217 ERR("Unsupported HRIR size: irSize=%d (%d to %d by %d)\n",
218 irSize
, MIN_IR_SIZE
, MAX_IR_SIZE
, MOD_IR_SIZE
);
221 if(evCount
< MIN_EV_COUNT
|| evCount
> MAX_EV_COUNT
)
223 ERR("Unsupported elevation count: evCount=%d (%d to %d)\n",
224 evCount
, MIN_EV_COUNT
, MAX_EV_COUNT
);
231 azCount
= malloc(sizeof(azCount
[0])*evCount
);
232 evOffset
= malloc(sizeof(evOffset
[0])*evCount
);
233 if(azCount
== NULL
|| evOffset
== NULL
)
235 ERR("Out of memory.\n");
241 evOffset
[0] = fgetc(f
);
242 evOffset
[0] |= fgetc(f
)<<8;
243 for(i
= 1;i
< evCount
;i
++)
245 evOffset
[i
] = fgetc(f
);
246 evOffset
[i
] |= fgetc(f
)<<8;
247 if(evOffset
[i
] <= evOffset
[i
-1])
249 ERR("Invalid evOffset: evOffset[%d]=%d (last=%d)\n",
250 i
, evOffset
[i
], evOffset
[i
-1]);
254 azCount
[i
-1] = evOffset
[i
] - evOffset
[i
-1];
255 if(azCount
[i
-1] < MIN_AZ_COUNT
|| azCount
[i
-1] > MAX_AZ_COUNT
)
257 ERR("Unsupported azimuth count: azCount[%d]=%d (%d to %d)\n",
258 i
-1, azCount
[i
-1], MIN_AZ_COUNT
, MAX_AZ_COUNT
);
262 if(irCount
<= evOffset
[i
-1])
264 ERR("Invalid evOffset: evOffset[%d]=%d (irCount=%d)\n",
265 i
-1, evOffset
[i
-1], irCount
);
269 azCount
[i
-1] = irCount
- evOffset
[i
-1];
270 if(azCount
[i
-1] < MIN_AZ_COUNT
|| azCount
[i
-1] > MAX_AZ_COUNT
)
272 ERR("Unsupported azimuth count: azCount[%d]=%d (%d to %d)\n",
273 i
-1, azCount
[i
-1], MIN_AZ_COUNT
, MAX_AZ_COUNT
);
280 coeffs
= malloc(sizeof(coeffs
[0])*irSize
*irCount
);
281 delays
= malloc(sizeof(delays
[0])*irCount
);
282 if(coeffs
== NULL
|| delays
== NULL
)
284 ERR("Out of memory.\n");
291 for(i
= 0;i
< irCount
*irSize
;i
+=irSize
)
293 for(j
= 0;j
< irSize
;j
++)
297 coeff
|= fgetc(f
)<<8;
301 for(i
= 0;i
< irCount
;i
++)
303 delays
[i
] = fgetc(f
);
304 if(delays
[i
] > maxDelay
)
306 ERR("Invalid delays[%d]: %d (%d)\n", i
, delays
[i
], maxDelay
);
313 ERR("Premature end of data\n");
320 size_t total
= sizeof(struct Hrtf
);
321 total
+= sizeof(azCount
[0])*evCount
;
322 total
+= sizeof(evOffset
[0])*evCount
;
323 total
+= sizeof(coeffs
[0])*irSize
*irCount
;
324 total
+= sizeof(delays
[0])*irCount
;
325 total
+= al_string_length(filename
)+1;
327 Hrtf
= malloc(total
);
330 ERR("Out of memory.\n");
337 Hrtf
->sampleRate
= rate
;
338 Hrtf
->irSize
= irSize
;
339 Hrtf
->evCount
= evCount
;
340 Hrtf
->azCount
= ((ALubyte
*)(Hrtf
+1));
341 Hrtf
->evOffset
= ((ALushort
*)(Hrtf
->azCount
+ evCount
));
342 Hrtf
->coeffs
= ((ALshort
*)(Hrtf
->evOffset
+ evCount
));
343 Hrtf
->delays
= ((ALubyte
*)(Hrtf
->coeffs
+ irSize
*irCount
));
344 Hrtf
->filename
= ((char*)(Hrtf
->delays
+ irCount
));
347 memcpy((void*)Hrtf
->azCount
, azCount
, sizeof(azCount
[0])*evCount
);
348 memcpy((void*)Hrtf
->evOffset
, evOffset
, sizeof(evOffset
[0])*evCount
);
349 memcpy((void*)Hrtf
->coeffs
, coeffs
, sizeof(coeffs
[0])*irSize
*irCount
);
350 memcpy((void*)Hrtf
->delays
, delays
, sizeof(delays
[0])*irCount
);
351 memcpy((void*)Hrtf
->filename
, al_string_get_cstr(filename
), al_string_length(filename
)+1);
362 static struct Hrtf
*LoadHrtf01(FILE *f
, const_al_string filename
)
364 const ALubyte maxDelay
= HRTF_HISTORY_LENGTH
-1;
365 struct Hrtf
*Hrtf
= NULL
;
366 ALboolean failed
= AL_FALSE
;
367 ALuint rate
= 0, irCount
= 0;
368 ALubyte irSize
= 0, evCount
= 0;
369 ALubyte
*azCount
= NULL
;
370 ALushort
*evOffset
= NULL
;
371 ALshort
*coeffs
= NULL
;
372 ALubyte
*delays
= NULL
;
377 rate
|= fgetc(f
)<<16;
378 rate
|= fgetc(f
)<<24;
384 if(irSize
< MIN_IR_SIZE
|| irSize
> MAX_IR_SIZE
|| (irSize
%MOD_IR_SIZE
))
386 ERR("Unsupported HRIR size: irSize=%d (%d to %d by %d)\n",
387 irSize
, MIN_IR_SIZE
, MAX_IR_SIZE
, MOD_IR_SIZE
);
390 if(evCount
< MIN_EV_COUNT
|| evCount
> MAX_EV_COUNT
)
392 ERR("Unsupported elevation count: evCount=%d (%d to %d)\n",
393 evCount
, MIN_EV_COUNT
, MAX_EV_COUNT
);
400 azCount
= malloc(sizeof(azCount
[0])*evCount
);
401 evOffset
= malloc(sizeof(evOffset
[0])*evCount
);
402 if(azCount
== NULL
|| evOffset
== NULL
)
404 ERR("Out of memory.\n");
410 for(i
= 0;i
< evCount
;i
++)
412 azCount
[i
] = fgetc(f
);
413 if(azCount
[i
] < MIN_AZ_COUNT
|| azCount
[i
] > MAX_AZ_COUNT
)
415 ERR("Unsupported azimuth count: azCount[%d]=%d (%d to %d)\n",
416 i
, azCount
[i
], MIN_AZ_COUNT
, MAX_AZ_COUNT
);
425 irCount
= azCount
[0];
426 for(i
= 1;i
< evCount
;i
++)
428 evOffset
[i
] = evOffset
[i
-1] + azCount
[i
-1];
429 irCount
+= azCount
[i
];
432 coeffs
= malloc(sizeof(coeffs
[0])*irSize
*irCount
);
433 delays
= malloc(sizeof(delays
[0])*irCount
);
434 if(coeffs
== NULL
|| delays
== NULL
)
436 ERR("Out of memory.\n");
443 for(i
= 0;i
< irCount
*irSize
;i
+=irSize
)
445 for(j
= 0;j
< irSize
;j
++)
449 coeff
|= fgetc(f
)<<8;
453 for(i
= 0;i
< irCount
;i
++)
455 delays
[i
] = fgetc(f
);
456 if(delays
[i
] > maxDelay
)
458 ERR("Invalid delays[%d]: %d (%d)\n", i
, delays
[i
], maxDelay
);
465 ERR("Premature end of data\n");
472 size_t total
= sizeof(struct Hrtf
);
473 total
+= sizeof(azCount
[0])*evCount
;
474 total
+= sizeof(evOffset
[0])*evCount
;
475 total
+= sizeof(coeffs
[0])*irSize
*irCount
;
476 total
+= sizeof(delays
[0])*irCount
;
477 total
+= al_string_length(filename
)+1;
479 Hrtf
= malloc(total
);
482 ERR("Out of memory.\n");
489 Hrtf
->sampleRate
= rate
;
490 Hrtf
->irSize
= irSize
;
491 Hrtf
->evCount
= evCount
;
492 Hrtf
->azCount
= ((ALubyte
*)(Hrtf
+1));
493 Hrtf
->evOffset
= ((ALushort
*)(Hrtf
->azCount
+ evCount
));
494 Hrtf
->coeffs
= ((ALshort
*)(Hrtf
->evOffset
+ evCount
));
495 Hrtf
->delays
= ((ALubyte
*)(Hrtf
->coeffs
+ irSize
*irCount
));
496 Hrtf
->filename
= ((char*)(Hrtf
->delays
+ irCount
));
499 memcpy((void*)Hrtf
->azCount
, azCount
, sizeof(azCount
[0])*evCount
);
500 memcpy((void*)Hrtf
->evOffset
, evOffset
, sizeof(evOffset
[0])*evCount
);
501 memcpy((void*)Hrtf
->coeffs
, coeffs
, sizeof(coeffs
[0])*irSize
*irCount
);
502 memcpy((void*)Hrtf
->delays
, delays
, sizeof(delays
[0])*irCount
);
503 memcpy((void*)Hrtf
->filename
, al_string_get_cstr(filename
), al_string_length(filename
)+1);
514 static void AddFileEntry(vector_HrtfEntry
*list
, al_string
*filename
)
516 HrtfEntry entry
= { AL_STRING_INIT_STATIC(), NULL
};
517 struct Hrtf
*hrtf
= NULL
;
518 const HrtfEntry
*iter
;
525 name
= strrchr(al_string_get_cstr(*filename
), '/');
526 if(!name
) name
= strrchr(al_string_get_cstr(*filename
), '\\');
527 if(!name
) name
= al_string_get_cstr(*filename
);
530 entry
.hrtf
= LoadedHrtfs
;
533 if(al_string_cmp_cstr(*filename
, entry
.hrtf
->filename
) == 0)
535 TRACE("Skipping duplicate file entry %s\n", al_string_get_cstr(*filename
));
538 entry
.hrtf
= entry
.hrtf
->next
;
541 TRACE("Loading %s...\n", al_string_get_cstr(*filename
));
542 f
= al_fopen(al_string_get_cstr(*filename
), "rb");
545 ERR("Could not open %s\n", al_string_get_cstr(*filename
));
549 if(fread(magic
, 1, sizeof(magic
), f
) != sizeof(magic
))
550 ERR("Failed to read header from %s\n", al_string_get_cstr(*filename
));
553 if(memcmp(magic
, magicMarker00
, sizeof(magicMarker00
)) == 0)
555 TRACE("Detected data set format v0\n");
556 hrtf
= LoadHrtf00(f
, *filename
);
558 else if(memcmp(magic
, magicMarker01
, sizeof(magicMarker01
)) == 0)
560 TRACE("Detected data set format v1\n");
561 hrtf
= LoadHrtf01(f
, *filename
);
564 ERR("Invalid header in %s: \"%.8s\"\n", al_string_get_cstr(*filename
), magic
);
570 ERR("Failed to load %s\n", al_string_get_cstr(*filename
));
574 hrtf
->next
= LoadedHrtfs
;
576 TRACE("Loaded HRTF support for format: %s %uhz\n",
577 DevFmtChannelsString(DevFmtStereo
), hrtf
->sampleRate
);
580 /* TODO: Get a human-readable name from the HRTF data (possibly coming in a
582 ext
= strrchr(name
, '.');
587 al_string_copy_cstr(&entry
.name
, name
);
589 al_string_copy_range(&entry
.name
, name
, ext
);
593 snprintf(str
, sizeof(str
), " #%d", i
+1);
594 al_string_append_cstr(&entry
.name
, str
);
598 #define MATCH_NAME(i) (al_string_cmp(entry.name, (i)->name) == 0)
599 VECTOR_FIND_IF(iter
, const HrtfEntry
, *list
, MATCH_NAME
);
601 } while(iter
!= VECTOR_END(*list
));
603 TRACE("Adding entry \"%s\" from file \"%s\"\n", al_string_get_cstr(entry
.name
),
604 al_string_get_cstr(*filename
));
605 VECTOR_PUSH_BACK(*list
, entry
);
608 al_string_deinit(filename
);
611 vector_HrtfEntry
EnumerateHrtf(const_al_string devname
)
613 vector_HrtfEntry list
= VECTOR_INIT_STATIC();
614 const char *defaulthrtf
= "";
615 const char *pathlist
= "";
616 bool usedefaults
= true;
618 if(ConfigValueStr(al_string_get_cstr(devname
), NULL
, "hrtf-paths", &pathlist
))
620 while(pathlist
&& *pathlist
)
622 const char *next
, *end
;
624 while(isspace(*pathlist
) || *pathlist
== ',')
626 if(*pathlist
== '\0')
629 next
= strchr(pathlist
, ',');
634 end
= pathlist
+ strlen(pathlist
);
638 while(end
!= pathlist
&& isspace(*(end
-1)))
642 al_string pname
= AL_STRING_INIT_STATIC();
643 vector_al_string flist
;
645 al_string_append_range(&pname
, pathlist
, end
);
647 flist
= SearchDataFiles(".mhr", al_string_get_cstr(pname
));
648 VECTOR_FOR_EACH_PARAMS(al_string
, flist
, AddFileEntry
, &list
);
649 VECTOR_DEINIT(flist
);
651 al_string_deinit(&pname
);
657 else if(ConfigValueExists(al_string_get_cstr(devname
), NULL
, "hrtf_tables"))
658 ERR("The hrtf_tables option is deprecated, please use hrtf-paths instead.\n");
662 vector_al_string flist
= SearchDataFiles(".mhr", "openal/hrtf");
663 VECTOR_FOR_EACH_PARAMS(al_string
, flist
, AddFileEntry
, &list
);
664 VECTOR_DEINIT(flist
);
667 if(VECTOR_SIZE(list
) > 1 && ConfigValueStr(al_string_get_cstr(devname
), NULL
, "default-hrtf", &defaulthrtf
))
669 const HrtfEntry
*iter
;
670 /* Find the preferred HRTF and move it to the front of the list. */
671 #define FIND_ENTRY(i) (al_string_cmp_cstr((i)->name, defaulthrtf) == 0)
672 VECTOR_FIND_IF(iter
, const HrtfEntry
, list
, FIND_ENTRY
);
673 if(iter
!= VECTOR_END(list
) && iter
!= VECTOR_BEGIN(list
))
675 HrtfEntry entry
= *iter
;
676 memmove(&VECTOR_ELEM(list
,1), &VECTOR_ELEM(list
,0),
677 (iter
-VECTOR_BEGIN(list
))*sizeof(HrtfEntry
));
678 VECTOR_ELEM(list
,0) = entry
;
681 WARN("Failed to find default HRTF \"%s\"\n", defaulthrtf
);
688 void FreeHrtfList(vector_HrtfEntry
*list
)
690 #define CLEAR_ENTRY(i) do { \
691 al_string_deinit(&(i)->name); \
693 VECTOR_FOR_EACH(HrtfEntry
, *list
, CLEAR_ENTRY
);
694 VECTOR_DEINIT(*list
);
699 ALuint
GetHrtfSampleRate(const struct Hrtf
*Hrtf
)
701 return Hrtf
->sampleRate
;
704 ALuint
GetHrtfIrSize(const struct Hrtf
*Hrtf
)
712 struct Hrtf
*Hrtf
= LoadedHrtfs
;
717 struct Hrtf
*next
= Hrtf
->next
;