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) {
202
202
// If a sound is already playing, terminate execution
203
203
} else if ( _playing || _safeplaying ) {
204
204
throw new Error ( "play: audio system still playing previous sound" ) ;
205
+ } else if ( get_duration ( sound ) <= 0 ) {
206
+ return sound ;
205
207
} else {
206
208
// Declaring duration and wave variables
207
209
var wave = get_wave ( sound ) ;
@@ -308,6 +310,8 @@ function play(sound) {
308
310
// If a sound is already playing, terminate execution.
309
311
if ( _safeplaying || _playing ) {
310
312
throw new Error ( "play: audio system still playing previous sound" ) ;
313
+ } else if ( get_duration ( sound ) <= 0 ) {
314
+ return sound ;
311
315
} else {
312
316
// Discretize the input sound
313
317
var data = discretize ( get_wave ( sound ) , get_duration ( sound ) ) ;
You can’t perform that action at this time.
0 commit comments