Add music

This commit is contained in:
asraelite 2018-03-07 14:23:45 +00:00
parent 194c0bf846
commit bd97945e66
14 changed files with 82 additions and 20 deletions

View file

@ -16,8 +16,20 @@ export function start(name) {
}
export function stop(name) {
if (!playing.has(name)) return;
if (!playing.has(name)) return false;
let howl = playing.get(name);
if (howl.playing())
if (howl.playing()) {
howl.stop();
return true;
}
return false;
}
export function toggle(name) {
if (!stop(name)) start(name);
}
export function volume(name, level) {
if (!playing.has(name)) return;
playing.get(name).volume(level);
}