SOLVED About volume attenuation of audio_emitter

uni00

Member
Hello. I want to make the sound of the clock smaller as the player gets farther away. Even if falloff is set, the sound of the clock does not change at a certain volume. Is there any setting mistake?

GML:
clock create

ClockEmitter =audio_emitter_create();
audio_emitter_position(ClockEmitter,x,y,0);
    audio_emitter_falloff(ClockEmitter,100,100,1);
GML:
clock step

if(!audio_is_playing(sound2))
{
audio_play_sound_on(ClockEmitter,sound2,true,0);
}
 

rytan451

Member
According to the documentation, the sounds should start falling off at the distance of 100 units, and reach zero volume at the distance of 100 units. Consider instead setting the second parameter (the first 100) to a smaller value, like 20, or 50.
 

uni00

Member
Yes. I tried, but if the numerical value is audio_emitter_falloff(ClockEmitter,100,100,1);, if the numerical value is not the same value, there is no sound, I tried reducing one, but after all, it is the same value. Without it, there is no sound.

GML:
ClockEmitter =audio_emitter_create();
audio_falloff_set_model(audio_falloff_linear_distance);
audio_emitter_position(ClockEmitter,834,606,0);
        audio_emitter_falloff(ClockEmitter,100,100,1);
 

woods

Member
audio_emitter_position(ClockEmitter,834,606,0);
does this make the source far away from the clock?

what if you changed to this...
audio_emitter_position(ClockEmitter,x, y, 0);

then i bet you can set your falloff properly ;o)
 

uni00

Member
audio_emitter_position(ClockEmitter,834,606,0);
does this make the source far away from the clock?

what if you changed to this...
audio_emitter_position(ClockEmitter,x, y, 0);

then i bet you can set your falloff properly ;o)
Yes. I tried that too, but it didn't work.
 

woods

Member
Yes. I tried that too, but it didn't work.
at least we are failing on the same page .. hahaha
i'll take a side seat and let the pros have a stab at it
good luck friend
 

uni00

Member
at least we are failing on the same page .. hahaha
i'll take a side seat and let the pros have a stab at it
good luck friend
It was difficult to use the emitter since it was my first time. It seems that not only the position of the instance that emits the sound of the player but also the position of the listening side must be set.
GML:
player create

audio_falloff_set_model(audio_falloff_linear_distance_clamped);
audio_listener_orientation(0, 1, 0, 0, 0, 1);
audio_listener_position(x, y, 0);
GML:
step
audio_listener_position(x, y, 0);
 

woods

Member
clock x,y is the location of the emitter and player x,y is the listener
makes sense ;o)
glad ya got it figured out


audio_falloff_set_model(audio_falloff_linear_distance);
audio_emitter_position(clock.x,clock.y,clock.z)
audio_listener_position(player.x,player. y, player.z);
 
Top