Original Post
Hello.
I've been trying to set the sound position(2d space) of an openal sound source without much luck!
This is how im setting the listener's vector :
And when adding a sample to the quee im playing it like this :
But i can't hear any sound unless i comment out this line:
Which is way too frustrating so i would love to get some help on the matter!
Thanks for your attention.
I've been trying to set the sound position(2d space) of an openal sound source without much luck!
This is how im setting the listener's vector :
//Every frame
const Vector2& v = mgr->GetEntity("player")->GetPosition();
alListener3f(AL_POSITION,v.x,v.y,0.0f);
And when adding a sample to the quee im playing it like this :
Vector2 sndPos(listener - sound); //sound : offset of sound in 2d space , listener : player's position in 2d space
sndPos.x /= 100.0f;
sndPos.y /= 100.0f;
alSource3f(source,AL_POSITION,sndPos.x,sndPos.y,0.0f);
alSourcePlay(source);
But i can't hear any sound unless i comment out this line:
alSource3f(source,AL_POSITION,sndPos.x,sndPos.y,0.0f);
Which is way too frustrating so i would love to get some help on the matter!
Thanks for your attention.