From d436bd1227cc1fbb45d354df73cc94342aba6fec Mon Sep 17 00:00:00 2001 From: Caitlin Hennessy Date: Thu, 14 Dec 2017 09:41:01 -0800 Subject: [PATCH] Fix simulator stop() method --- sim/state/sounds.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sim/state/sounds.ts b/sim/state/sounds.ts index 1747dee0..ae84fd85 100644 --- a/sim/state/sounds.ts +++ b/sim/state/sounds.ts @@ -43,9 +43,12 @@ namespace pxsim.SoundMethods { } export function stop() { - if (audio) { - audio.pause(); - } + return new Promise(resolve => { + if (audio) { + audio.pause(); + numSoundsPlaying--; + } + }) } }