audio_emitter_gain()


サウンド

audio_emitter_gain

指定のエミッタの音量を変更します

構文

audio_emitter_gain(emitter, gain);
emitter
エミッタのインデックス番号
gain
音量(デフォルト「1」)

戻り値

N/A
なし

説明

This function sets the maximum gain (volume) for the sound. The perceived volume for a sound can change depending on the fall-off value and the position it has relative to the listener, but by setting the gain with this function, the full volume will never exceed the specified gain value. The image below illustrates how gain affects the volume of the emitter when fall-off is greater than 0:

audio_gain.png

This function will change the volume of the sound while it is being played as well all subsequent sounds played through the given emitter.

注意

the final volume will also be influenced by the global audio gain that has been set by the function audio_master_gain.


if up
{
  gain += 0.05;
  if gain >= 1 up = false;
}
else
{
  gain += 0.05;
  if gain <= 0 up = true;
}
audio_emitter_gain(s_emit, gain);

The above code sets the variable "gain" to different values and then uses that same variable to set the gain of the emitter indexed in the variable "s_emit".

Wiki内検索

#search(): You already view a search box

MENU

ドキュメント

GMLリファレンス

2ch

その他



最新の30件

2024-03-07 2023-08-09 2023-05-21 2023-05-20 2023-05-04 2022-10-13 2022-07-21 2022-07-02 2022-04-06 2021-11-30 2021-11-26 2021-10-03 2021-09-23 2021-08-15 2021-06-02 2021-01-23 2021-01-21 2021-01-19 2021-01-18 2021-01-16 2021-01-15

人気の10件

今日の10件



これまでの訪問者: 898
今日の訪問者: 2
昨日の訪問者: 1
閲覧者: 5