mirror of
https://github.com/scratchfoundation/scratch-audio.git
synced 2025-01-09 06:12:20 -05:00
check for non-existent sound
This commit is contained in:
parent
08a81af9e5
commit
dcdc2c0831
1 changed files with 5 additions and 0 deletions
|
@ -143,6 +143,11 @@ function AudioPlayer (audioEngine) {
|
||||||
}
|
}
|
||||||
|
|
||||||
AudioPlayer.prototype.playSound = function (md5) {
|
AudioPlayer.prototype.playSound = function (md5) {
|
||||||
|
// if this sound is not in the audio engine, return
|
||||||
|
if (!this.audioEngine.audioBuffers[md5]) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// if this sprite or clone is already playing this sound, stop it first
|
// if this sprite or clone is already playing this sound, stop it first
|
||||||
if (this.activeSoundPlayers[md5]) {
|
if (this.activeSoundPlayers[md5]) {
|
||||||
this.activeSoundPlayers[md5].stop();
|
this.activeSoundPlayers[md5].stop();
|
||||||
|
|
Loading…
Reference in a new issue