소스 검색

Added functions to stop all sounds

tags/v0.1.0
Fen Dweller 6 년 전
부모
커밋
bad48e0e15
No known key found for this signature in database GPG 키 ID: E80B35A6F11C3656
1개의 변경된 파일17개의 추가작업 그리고 0개의 파일을 삭제
  1. +17
    -0
      audio.js

+ 17
- 0
audio.js 파일 보기

@@ -59,6 +59,11 @@ function stopSfx(name) {
cleanPlaying();
}

function stopAllSfx() {
playing.map(item => item.stop());
cleanPlaying();
}

function stopLoop(name) {
if (looping[name]) {
looping[name].stop();
@@ -66,6 +71,18 @@ function stopLoop(name) {
}
}

function stopAllLoops() {
Object.entries(looping).forEach(([key, val]) => {
val.stop();
delete looping[key];
});
}

function stopAllSound() {
stopAllSfx();
stopAllLoops();
}

function cleanPlaying() {
playing = playing.filter(item => !item.done);
}


불러오는 중...
취소
저장