Skip to content

Commit

Permalink
Fix: [Client][Player/PlayerController] 文字スーパーで指定された index と異なる内蔵音が鳴るこ…
Browse files Browse the repository at this point in the history
…とがある問題を修正

非同期に実行したらそりゃ配列の順番ぐちゃぐちゃになるわ…
  • Loading branch information
tsukumijima committed Nov 24, 2023
1 parent 514ecc2 commit b21345b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions client/src/services/player/PlayerController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ class PlayerController {
}

// 01 ~ 14 まですべての RomSound を読み込む
for (let index = 1; index <= 14; index++) {
(async () => {
(async () => {
for (let index = 1; index <= 14; index++) {
// ArrayBuffer をデコードして AudioBuffer にし、すぐ呼び出せるように貯めておく
// ref: https://ics.media/entry/200427/
const romsound_url = `/assets/romsounds/${index.toString().padStart(2, '0')}.wav`;
Expand All @@ -137,8 +137,8 @@ class PlayerController {
if (romsound_response.type === 'success') {
this.romsounds_buffers.push(await this.romsounds_context.decodeAudioData(romsound_response.data));
}
})();
}
}
})();
}


Expand Down

0 comments on commit b21345b

Please sign in to comment.