audio_music_gain()


Game Maker Language リファレンス > 組み込み関数 用途別 > サウンド > audio_music_gain

audio_music_gain

BGMの音量を設定します(非推奨)

構文

audio_music_gain(volume, time);
volume
BGMの音量(0:無音 1:最大音量)
time
音量を変化させる時間(ミリ秒)

戻り値

N/A
なし

説明

注意! この関数は非推奨です。代わりにaudio_sound_gain()を使用してください。

With this function you can fade music in or out over a given length of time. The time is measured in milliseconds, and the function requires that you input a final gain for the sound to have reached by the end of that time. This gain will generally be between 0 (silent) and 1 (full volume) and the scale is logarithmic in nature, so a gain of 0.5 is not half volume, as illustrated by the image below:

sound_volume.png

This function will affect all music that can be played in the game and the final gain will set the volume at which all later music files will be played.

if val
{
  audio_music_gain(0, 0);
  audio_play_music(snd_music, true);
  audio_music_gain(1, 5000);
}

The above code checks a variable and if it returns true, the code will set the gain for the music indexed as "snd_Music" to 0, then start it playing, and then set the gain to fade up to full volume (1) over 5 seconds (5000 milliseconds).

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件



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