• Hey! Guest! The 37th GMC Jam will take place between May 28th, 12:00 UTC and June 1st, 12:00 UTC. Why not join in! Click here to find out more!

Two audio_listeners?

In my 2d top-down game I have splitscreen for two players. my game also implements 3d audio so both the player objects are 'listeners.' However if only it were as easy as to put audio_listener_position in the Step event of both player objects...
I acknowledge there are 'audio masks' (audio_emitter_set_listener_mask) which I should assign to both the player objects to make them listeners, I guess? I have no idea tho where to put the code etc...
Any help on how I can have two listener objs?
Thank you in advance.
 

Yal

šŸ§ *penguin noises*
GMC Elder
What would having two listeners achieve? Audio is still shared between the two player, since you only got one audio output device (which the user controls: side loudspeakers, built-in speaker, headset... you can't tell what they're using, it's just a dumb output channel your audio is routed into). Even if you could activate multiple listeners, sound would be heard from two different directions, which would be even more disorienting than what you have right now.

What you could do, going for the "play it twice" idea, is to have the listener be absolute, bound to the screen rather than follow the players around, and then when playing a sound, you play it once for each player, with a position based on the player's position relative to the sound (and in turn relative to the absolute listener). E.g. if the sound is to the right of one player and above another, play one instance of it to the right of the absolute listener and the other instance above it, with matching distances to the ABL that they have to the individual players.
 
What would having two listeners achieve? Audio is still shared between the two player, since you only got one audio output device (which the user controls: side loudspeakers, built-in speaker, headset... you can't tell what they're using, it's just a dumb output channel your audio is routed into). Even if you could activate multiple listeners, sound would be heard from two different directions, which would be even more disorienting than what you have right now.

What you could do, going for the "play it twice" idea, is to have the listener be absolute, bound to the screen rather than follow the players around, and then when playing a sound, you play it once for each player, with a position based on the player's position relative to the sound (and in turn relative to the absolute listener). E.g. if the sound is to the right of one player and above another, play one instance of it to the right of the absolute listener and the other instance above it, with matching distances to the ABL that they have to the individual players.
Yes, in my game's case, its relatively dumb as of now since if player 2's character is next to a sound-emitting object, no audio is heared until player 1 arrives to the scene and then the audio can be heard at last. Its just immersion-breaking and somewhat silly when p2's hearing has to depend on p1's position... if both players were on opposite edges of a room, making battle sounds for example, id like the sounds be heared from both of their sides...
I'll try ur suggestion out !
 
What would having two listeners achieve? Audio is still shared between the two player, since you only got one audio output device (which the user controls: side loudspeakers, built-in speaker, headset... you can't tell what they're using, it's just a dumb output channel your audio is routed into). Even if you could activate multiple listeners, sound would be heard from two different directions, which would be even more disorienting than what you have right now.

What you could do, going for the "play it twice" idea, is to have the listener be absolute, bound to the screen rather than follow the players around, and then when playing a sound, you play it once for each player, with a position based on the player's position relative to the sound (and in turn relative to the absolute listener). E.g. if the sound is to the right of one player and above another, play one instance of it to the right of the absolute listener and the other instance above it, with matching distances to the ABL that they have to the individual players.
So, is it even possible, to have two audios playing from one output device: for example if player 1 was moving further away to the left from the sound-emitter and player 2 was standing on the right side of it, could it be made so that the sound fades away on the left side of the output device but stays the same from the right?
Theoretically speaking ..
 

Yal

šŸ§ *penguin noises*
GMC Elder
I think you'd need to move the sounds rather than the listener for that effect... which seems to be impossible from what I can tell browsing the function list (there's audio_set_track_position but not audio_set_position...)
 
Top