using audio context manager function (#243)

* using audio context manager function

* updated pxt reference

* trigger build
This commit is contained in:
Peli de Halleux
2018-01-18 13:53:33 -08:00
committed by GitHub
parent ef5b4172e8
commit a60427e2cf
4 changed files with 8 additions and 22 deletions

View File

@ -291,6 +291,9 @@ namespace music {
export function playSoundEffect(sound: Sound) {
if (!sound || numSoundsPlaying >= soundsLimit) return;
numSoundsPlaying++;
control.runInBackground(() => {sound.play(); numSoundsPlaying--;});
control.runInBackground(() => {
sound.play();
numSoundsPlaying--;
});
}
}