pxt-microbit 5.1.37 → 5.1.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/built/sim.d.ts CHANGED
@@ -526,6 +526,7 @@ declare namespace pxsim.light {
526
526
  declare namespace pxsim.music {
527
527
  function setBuiltInSpeakerEnabled(enabled: boolean): void;
528
528
  function setSilenceLevel(level: number): void;
529
+ function isSoundPlaying(): boolean;
529
530
  }
530
531
  declare namespace pxsim.music {
531
532
  interface Progression {
package/built/sim.js CHANGED
@@ -2224,6 +2224,12 @@ var pxsim;
2224
2224
  // ignore in v1,v2
2225
2225
  }
2226
2226
  music.setSilenceLevel = setSilenceLevel;
2227
+ function isSoundPlaying() {
2228
+ const audioActive = pxsim.AudioContextManager.isAudioElementActive();
2229
+ const soundExpressionPlaying = pxsim.codal.music.isSoundExpPlaying();
2230
+ return audioActive || soundExpressionPlaying || pxsim.record.audioIsPlaying();
2231
+ }
2232
+ music.isSoundPlaying = isSoundPlaying;
2227
2233
  })(music = pxsim.music || (pxsim.music = {}));
2228
2234
  })(pxsim || (pxsim = {}));
2229
2235
  var pxsim;