File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
public/externalLibs/sound Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -202,6 +202,8 @@ function play_unsafe(sound) {
202202 // If a sound is already playing, terminate execution
203203 } else if ( _playing || _safeplaying ) {
204204 throw new Error ( "play: audio system still playing previous sound" ) ;
205+ } else if ( get_duration ( sound ) <= 0 ) {
206+ return sound ;
205207 } else {
206208 // Declaring duration and wave variables
207209 var wave = get_wave ( sound ) ;
@@ -308,6 +310,8 @@ function play(sound) {
308310 // If a sound is already playing, terminate execution.
309311 if ( _safeplaying || _playing ) {
310312 throw new Error ( "play: audio system still playing previous sound" ) ;
313+ } else if ( get_duration ( sound ) <= 0 ) {
314+ return sound ;
311315 } else {
312316 // Discretize the input sound
313317 var data = discretize ( get_wave ( sound ) , get_duration ( sound ) ) ;
You can’t perform that action at this time.
0 commit comments