[openal] problem with alc_is_extension_present?

Michael Taboada ai5hf at hotmail.com
Fri Apr 8 09:12:26 EDT 2016


Hi,
I was working on my simple openal soft abstraction layer, and was having 
trouble getting hrtf to enable. I finally tracked down the premature 
exit of my enable method to the part where it checks to see if the hrtf 
extension is present, and if not just returns false. I know the hrtf 
extension is present (I'm running openal soft 1.17.2), and the sample 
code below shows it is. My repository can be found at 
https://github.com/lilmike/sound3d. My sample code to test it is below, 
any thoughts welcome on why it's thinking the hrtf extension is not present.
Also, this selects the first hrtf by default, just for testing. I think 
it only enumerates hrtf tables in the directories searched for .mhr 
files, so make sure there is one available in one of those directories.
The only function failing so far that I can tell is 
sound3d::set_hrtf(bool, int) (near the bottom of sound3d.cpp).

-Michael.

#include "sound3d.h"
#include <windows.h>
#include <iostream>
using namespace std;

int main() {
sound3d s;
/*
ALCdevice* d = s.get_device();
ALCint num;
alcGetIntegerv(d, ALC_NUM_HRTF_SPECIFIERS_SOFT, 1, &num);
LPALCGETSTRINGISOFT ags = (LPALCGETSTRINGISOFT)(alcGetProcAddress(d, 
"alcGetStringiSOFT"));
for(int i = 0; i < num; i++) {
cout << i << ": " << ags(d, ALC_HRTF_SPECIFIER_SOFT, i) << endl;
}
return 0;
*/
//uncomment the above block to show that hrtf is present.
s.load("test.ogg");
s.set_loops(true);
if(!s.set_hrtf(true, 0)) {
cout << "failed!" << endl;
return 0;
}
s.set_coords(2, 0, 0);
s.play();
Sleep(1000);
s.set_coords(2, 2, 0);
Sleep(1000);
s.set_coords(0, 2, 0);
Sleep(1000);
s.set_coords(-2, 0, 0);
Sleep(1000);
s.set_coords(-2, -2, 0);
Sleep(1000);
s.set_coords(0, -2, 0);
Sleep(1000);
s.set_coords(2, -2, 0);
Sleep(1000);
s.set_coords(2, 0, 0);
Sleep(1000);
}



More information about the openal mailing list