mirror of
https://github.com/scratchfoundation/scratch-audio.git
synced 2024-12-22 14:02:29 -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) {
|
||||
// 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.activeSoundPlayers[md5]) {
|
||||
this.activeSoundPlayers[md5].stop();
|
||||
|
|
Loading…
Reference in a new issue