3D 3D Audio is not orientating?

Kreastricon

Member
So I have a game that I am working on and the 3D audio is not working the way I am expecting it to. I think it has to do with me not understanding how audio orientation works.

I'm making a 3D game, yet for some reason the audio plays in the wrong ear.

I'm using this code in the end step of my player object:

GML:
var xx,yy;
xx=lengthdir_x(3,C_Direction)
yy=lengthdir_y(3,C_Direction)    //C Direction is the direction camera is facing.
audio_listener_position(x,y,z)
audio_listener_orientation(x+xx,y+yy,z,0,0,1)
I am using the function audio_play_sound_at() to create the sounds in my environment by using a bad guy who walks around making footsteps. I think the best way to describe the situation is that I know for a fact that the sounds are being played at the right location yet the game behaves as if my head is not turning. If I look to the east, my audio plays fine in each ear, but if I look to the west, it acts as if I didn't turn my head and it plays in the opposite ears. Does that make sense?

I do not use audio emitters nor do I use any audio velocity. I also made sure my sounds were switched to 3D. I use audio_falloff_exponential.

I'm using Game Maker 1.49999
 
Last edited:

Kreastricon

Member
SOLVED IT!

Apparently, I was reading the function wrong this whole time.

GML:
var xx,yy;
xx=lengthdir_x(3,C_Direction)
yy=lengthdir_y(3,C_Direction)

audio_listener_position(x,y,0)
audio_listener_orientation(xx,yy,z,0,0,-1)
I originally had the x and y values of my player in the orientation function, so I had to remove them. I also made the zup value -1 so it would play in the right ears.

It didn't occur to me that the orientation function did not need the player coordinates. Only the position function does. Boy do I feel stupid...
 
Top