Add stopSong

This commit is contained in:
Ketchetwahmeegwun T. Southall 2022-01-30 05:02:28 -08:00
parent c6b70c3bdd
commit cdf74e2999

View File

@ -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()