Add stopSong
This commit is contained in:
parent
c6b70c3bdd
commit
cdf74e2999
|
@ -90,6 +90,12 @@ export function playSong(name: string) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function stopSong() {
|
||||||
|
if (playingSongAudio && !playingSongAudio.paused) {
|
||||||
|
playingSongAudio.pause()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export function playSound(name: string, volume: number): HTMLAudioElement|undefined {
|
export function playSound(name: string, volume: number): HTMLAudioElement|undefined {
|
||||||
if (!enabled) return
|
if (!enabled) return
|
||||||
let s = audioCache.pop()
|
let s = audioCache.pop()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user