Skip to content

Commit

Permalink
Merge pull request #109 from anatawa12/re-fix-sound
Browse files Browse the repository at this point in the history
Re-fix sound
  • Loading branch information
anatawa12 authored Nov 29, 2023
2 parents 7779c76 + 3f858a6 commit 355d468
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions packages/frontend/src/scripts/sound.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,13 @@ export function play(type: 'noteMy' | 'note' | 'antenna' | 'channel' | 'notifica
if (_DEV_) console.log('play', type, sound);
if (sound.type == null || !canPlay) return;

(async () => {
canPlay = false;
try {
await playFile(sound.type, sound.volume);
} finally {
// γ”γηŸ­ζ™‚ι–“γ«ιŸ³γŒι‡θ€‡γ—γͺγ„γ‚ˆγ†γ«
setTimeout(() => {
canPlay = true;
}, 25);
}
})();
canPlay = false;
playFile(sound).finally(() => {
// γ”γηŸ­ζ™‚ι–“γ«ιŸ³γŒι‡θ€‡γ—γͺγ„γ‚ˆγ†γ«
setTimeout(() => {
canPlay = true;
}, 25);
});
}

export async function playFile(file: string, volume: number) {
Expand Down

0 comments on commit 355d468

Please sign in to comment.