wyrian/js/sounds.load.js
Guillaume DE LA RUE 590ba65d18 Version 0.2c :
- Add sound effects
2011-02-13 14:28:05 +01:00

72 lines
1.8 KiB
JavaScript

/**************************************************************************
* SOUNDMANAGER CONFIG
***************************************************************************/
soundManager.useFlashBlock = false;
soundManager.bgColor = '#ffffff';
soundManager.debugMode = false;
soundManager.url = 'http://patator.socialmixmedia.fr/assets/js/soundmanager/swf/';
soundManager.wmode = 'transparent'; // hide initial flash of white on everything except firefox/win32
soundManager.allowScriptAccess = 'always';
soundManager.useFastPolling = true;
soundManager.flashVersion = 9;
soundManager.flashLoadTimeout = 3000;
soundManager.useHTML5Audio = true;
// -- when ready, preload sounds
soundManager.onready(function() {
// -- Background Music
soundManager.createSound({
id: 'music',
url: '/audio/bg_music.ogg',
autoLoad: true,
autoPlay: false,
multiShot: false,
volume: 10,
loop: true,
onload: function() {
this.play() ;
},
onfinish: function() {
this.play();
}
});
// -- Click
soundManager.createSound({
id: 'click',
url: '/audio/click.ogg',
autoLoad: true,
autoPlay: false,
multiShot: false,
volume: 50
});
// -- Fire
soundManager.createSound({
id: 'shoot',
url: '/audio/big_laser.ogg',
autoLoad: true,
autoPlay: false,
multiShot: true,
volume: 30
});
// -- Explode
soundManager.createSound({
id: 'explode',
url: '/audio/explode.ogg',
autoLoad: true,
autoPlay: false,
multiShot: true,
volume: 10
});
});
soundManager.ontimeout(function() {
var smLoadFailWarning = 'Oh snap! : ' + (soundManager.hasHTML5 ? 'The flash portion of ' : '') + 'SoundManager 2 was unable to start. ';
_log(smLoadFailWarning) ;
});