audio_emitter_get_gain


描述

This function returns the current gain (volume) set for the given audio emitter, normally between 0 and 1, where 0 is silent and 1 is full volume. Note that on some platforms you can have a gain of greater than 1, although a value of 1 is considered "full volume" and anything greater may introduce audio clipping.


语法:

audio_emitter_get_gain(emitter);


参数 描述
emitter The index of the emitter to use.


返回:

Real(实数)


例如:

if audio_emitter_get_gain(emitter_player) < 1
   {
   audio_emitter_gain(emitter_player, 1);
   }

The above code checks the current gain of a given emitter and if it is less than 1 it is set to 1.