Classes AudioManager - hikipuro/rpgmakermv_ref GitHub Wiki
AudioManager クラス
[クラス一覧]
(ver.1.6.2)
BGM, BGS, ME, SE を管理
定義場所: rpg_managers.js
クラスの属性
- Static クラス
関連項目
フィールド
名前 | 型 | 初期値 | 説明 |
---|---|---|---|
_masterVolume | number | 1 | (Static) マスター音量 (0 - 1) |
_bgmVolume | number | 100 | (Static) BGM音量 (0 - 100) |
_bgsVolume | number | 100 | (Static) BGS音量 (0 - 100) |
_meVolume | number | 100 | (Static) ME音量 (0 - 100) |
_seVolume | number | 100 | (Static) SE音量 (0 - 100) |
_currentBgm | AudioObject | null | (Static) 現在のBGM |
_currentBgs | AudioObject | null | (Static) 現在のBGS |
_bgmBuffer | Html5Audio or WebAudio | null | (Static) 現在再生中のBGMのバッファ |
_bgsBuffer | Html5Audio or WebAudio | null | (Static) 現在再生中のBGSのバッファ |
_meBuffer | Html5Audio or WebAudio | null | (Static) 現在再生中のMEのバッファ |
_seBuffers | Array.<Html5Audio or WebAudio> | [] | (Static) 現在再生中のSEのバッファの配列 |
_staticBuffers | Array.<Html5Audio or WebAudio> | [] | (Static) プリロード済みSEのバッファの配列 |
_replayFadeTime | number | 0.5 | (Static) リプレイ時のフェード時間 (秒単位) |
_path | string | "audio/" | (Static) オーディオファイルのベースパス |
_blobUrl | string | null | (Static) URL文字列 (createDecryptBuffer() で使用する) |
プロパティ
名前 | 型 | 説明 |
---|---|---|
masterVolume | number | マスター音量 (0 - 1) |
bgmVolume | number | BGM音量 (0 - 100) |
bgsVolume | number | BGS音量 (0 - 100) |
meVolume | number | ME音量 (0 - 100) |
seVolume | number | SE音量 (0 - 100) |
メソッド
名前 | 説明 |
---|---|
playBgm | BGMを再生する |
playEncryptedBgm | 暗号化されたBGMを再生する |
createDecryptBuffer | 暗号化されたファイルからオーディオバッファを作成する |
replayBgm | |
isCurrentBgm | 現在再生中のBGMか確認 |
updateBgmParameters | |
updateCurrentBgm | |
stopBgm | BGMを停止する |
fadeOutBgm | BGMをフェードアウトする |
fadeInBgm | BGMをフェードインする |
playBgs | BGSを再生する |
replayBgs | |
isCurrentBgs | 現在再生中のBGSか確認 |
updateBgsParameters | |
updateCurrentBgs | |
stopBgs | BGSを停止する |
fadeOutBgs | BGSをフェードアウトする |
fadeInBgs | BGSをフェードインする |
playMe | MEを再生する |
updateMeParameters | |
fadeOutMe | MEをフェードアウトする |
stopMe | MEを停止する |
playSe | SEを再生する |
updateSeParameters | |
stopSe | SEを停止する |
playStaticSe | プリロード済みのSEを再生する |
loadStaticSe | SEをプリロードする |
isStaticSe | SEがプリロード済みか確認する |
stopAll | すべての音声を停止する |
saveBgm | |
saveBgs | |
makeEmptyAudioObject | 空のオーディオオブジェクトを作成する |
createBuffer | オーディオバッファを作成する |
updateBufferParameters | |
audioFileExt | オーディオファイルの拡張子を取得 |
shouldUseHtml5Audio | Html5Audio の使用を強制するか確認 |
checkErrors | |
checkWebAudioError |
playBgm
定義: playBgm(bgm, pos)
BGMを再生する
引数 | 型 | 説明 |
---|---|---|
bgm | AudioObject | |
pos | number |
playEncryptedBgm
定義: playEncryptedBgm(bgm, pos)
暗号化されたBGMを再生する
引数 | 型 | 説明 |
---|---|---|
bgm | AudioObject | |
pos | number |
createDecryptBuffer
定義: createDecryptBuffer(url, bgm, pos)
暗号化されたファイルからオーディオバッファを作成する
引数 | 型 | 説明 |
---|---|---|
url | string | |
bgm | AudioObject | |
pos | number |
replayBgm
定義: replayBgm(bgm)
引数 | 型 | 説明 |
---|---|---|
bgm | AudioObject |
isCurrentBgm
定義: isCurrentBgm(bgm)
現在再生中のBGMか確認
引数 | 型 | 説明 |
---|---|---|
bgm | AudioObject |
updateBgmParameters
定義: updateBgmParameters(bgm)
引数 | 型 | 説明 |
---|---|---|
bgm | AudioObject |
updateCurrentBgm
定義: updateCurrentBgm(bgm, pos)
引数 | 型 | 説明 |
---|---|---|
bgm | AudioObject | |
pos | number |
stopBgm
定義: stopBgm()
BGMを停止する
fadeOutBgm
定義: fadeOutBgm(duration)
BGMをフェードアウトする
引数 | 型 | 説明 |
---|---|---|
duration | number | 秒単位の時間 |
fadeInBgm
定義: fadeInBgm(duration)
BGMをフェードインする
引数 | 型 | 説明 |
---|---|---|
duration | number | 秒単位の時間 |
playBgs
定義: playBgs(bgs, pos)
BGSを再生する
引数 | 型 | 説明 |
---|---|---|
bgs | AudioObject | |
pos | number |
replayBgs
定義: replayBgs(bgs)
引数 | 型 | 説明 |
---|---|---|
bgs | AudioObject |
isCurrentBgs
定義: isCurrentBgs(bgs)
現在再生中のBGSか確認
引数 | 型 | 説明 |
---|---|---|
bgs | AudioObject |
updateBgsParameters
定義: updateBgsParameters(bgs)
引数 | 型 | 説明 |
---|---|---|
bgs | AudioObject |
updateCurrentBgs
定義: updateCurrentBgs(bgs, pos)
引数 | 型 | 説明 |
---|---|---|
bgs | AudioObject | |
pos | number |
stopBgs
定義: stopBgs()
BGSを停止する
fadeOutBgs
定義: fadeOutBgs(duration)
BGSをフェードアウトする
引数 | 型 | 説明 |
---|---|---|
duration | number | 秒単位の時間 |
fadeInBgs
定義: fadeInBgs(duration)
BGSをフェードインする
引数 | 型 | 説明 |
---|---|---|
duration | number | 秒単位の時間 |
playMe
定義: playMe(me)
MEを再生する
引数 | 型 | 説明 |
---|---|---|
me | AudioObject |
updateMeParameters
定義: updateMeParameters(me)
引数 | 型 | 説明 |
---|---|---|
me | AudioObject |
fadeOutMe
定義: fadeOutMe(duration)
MEをフェードアウトする
引数 | 型 | 説明 |
---|---|---|
duration | number | 秒単位の時間 |
stopMe
定義: stopMe()
MEを停止する
playSe
定義: playSe(se)
SEを再生する
引数 | 型 | 説明 |
---|---|---|
se | AudioObject |
updateSeParameters
定義: updateSeParameters(buffer, se)
引数 | 型 | 説明 |
---|---|---|
buffer | ||
se | AudioObject |
stopSe
定義: stopSe()
SEを停止する
playStaticSe
定義: playStaticSe(se)
プリロード済みのSEを再生する
引数 | 型 | 説明 |
---|---|---|
se | AudioObject |
loadStaticSe
定義: loadStaticSe(se)
SEをプリロードする
引数 | 型 | 説明 |
---|---|---|
se | AudioObject |
isStaticSe
定義: isStaticSe(se)
SEがプリロード済みか確認する
引数 | 型 | 説明 |
---|---|---|
se | AudioObject |
stopAll
定義: stopAll()
すべての音声を停止する
saveBgm
定義: saveBgm()
saveBgs
定義: saveBgs()
makeEmptyAudioObject
定義: makeEmptyAudioObject()
空のオーディオオブジェクトを作成する
戻り値
(AudioObject) { name: '', volume: 0, pitch: 0 }
createBuffer
定義: createBuffer(folder, name)
オーディオバッファを作成する
引数 | 型 | 説明 |
---|---|---|
folder | string | フォルダ名 |
name | string | ファイル名 |
戻り値
Html5Audio または WebAudio
updateBufferParameters
定義: updateBufferParameters(buffer, configVolume, audio)
引数 | 型 | 説明 |
---|---|---|
buffer | ||
configVolume | ||
audio |
audioFileExt
定義: audioFileExt()
オーディオファイルの拡張子を取得
戻り値
(string)
- ogg が再生可能かつモバイルデバイスではない場合: "ogg"
- それ以外: "m4a"
shouldUseHtml5Audio
定義: shouldUseHtml5Audio()
Html5Audio の使用を強制するか確認
戻り値
(boolean) false
checkErrors
定義: checkErrors()
checkWebAudioError
定義: checkWebAudioError(webAudio)
引数 | 型 | 説明 |
---|---|---|
webAudio |