lib/melonJS-0.9.4.js
/*
		 * ---
		 * 
		 * event listener callback when a sound is loaded
		 * 
		 * ---
		 */
event listener callback when a sound is loaded
event listener callback when a sound is loaded
function soundLoaded(sound_id, sound_channel) {
			retry_counter = 0;
			if (sound_channel > 1) {
				var soundclip = audio_channels[sound_id][0];
				for (var channel = 1; channel < sound_channel; channel++) {
					var node = soundclip.cloneNode(true);
					if (node.currentSrc.length == 0) {
						node.src = soundclip.src;
					}
					audio_channels[sound_id][channel] = node;
					audio_channels[sound_id][channel].load();
				}
			}
			if (load_cb) {
				load_cb();
			}
		}
function soundLoaded ( sound_id , sound_channel ) { retry_counter = 0 ; if ( sound_channel > 1 ) { var soundclip = audio_channels [ sound_id ] [ 0 ] ; for ( var channel = 1 ; channel < sound_channel ; channel ++ ) { var node = soundclip . cloneNode ( true ) ; if ( node . currentSrc . length == 0 ) { node . src = soundclip . src ; } audio_channels [ sound_id ] [ channel ] = node ; audio_channels [ sound_id ] [ channel ] . load ( ) ; } } if ( load_cb ) { load_cb ( ) ; } }
// reset the retry counter // create other "copy" channels if necessary // clone copy to create multiple channel version // make sure it's a new copy each time // fix for IE platform not properly // initializating everything when using cloneNode // allocate the new channel // callback if defined