Windows Sound emitters stopping

Hey guys, here's the deal.

I am making an open world game with cars. They make sounds via an emitter. The sound loops and changes in pitch based on how fast the car is going.

If a player drives the car, then the priority is 100, otherwise, it is 20. The only sounds that are in the game are these emitters and crash sounds. The emitters are only created once a car is interacted with (let's say, once we touch it with our own car).

The issue is, if I crash a few cars at the same time, then my own car, the one with the highest priority stops. If I leave the area, make the sound stop by getting out of the car and re-entering it starts again. even the crash sounds, which are not made with emitters make it stop.

I have set audio_channel_num to 256 but It doesn't seem to make any difference

This is the code. (or the part thats relevant

if seat1 <3 var priority = 100 else var priority = 20
if engine_soundplaying = 0 {engine_soundplaying = audio_play_sound_on(engine_emitter,engine_sound,true,priority) audio_emitter_gain(engine_emitter,1) }
// moving emitter
audio_update_emitter_at_listener(engine_emitter,x,y)

// car pitch
{audio_emitter_pitch(engine_emitter, 0.5+gearpitch/20)}

Am I doing something wrong, or do I just need to toy around with priorities more and use fewer sounds? Because I am not using that many at all.
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Do you have code to stop the sounds being played? Could it be that something in your project is calling the stop code prematurely rather than it being an audio priority problem?
 
The sound stops if the car stops (it changes into an engine idle sound) or when a car is deleted. If the sound of my car stops, I have to stop the car to play the idle sound and then accelerate again.

I've noticed that messing with the priority of the sound and giving cars different engine sounds helped a bit. ( I can crash more before my own sound stops again)
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Hmmm... Might be worth filing a bug report (include a link to a stripped down project that shows the issue), although I'm pretty sure I've had LOTS of sounds playing before and not had them cut off like this. That said I don't use emitters all that often so it could be an issue with them. What happens if you don't use an emitter and just play the sounds themselves?
 
Haven't tested, but without emitters, I can't move the sound with the car so emitters nor change it in meaningful ways. I will test more and If i can't find any issues with my code then I will file a bug report :)
 
Top