Sindbad~EG File Manager
H5P.ArithmeticQuiz.SoundEffects = (function () {
var SoundEffects = {
types: [
'positive-short',
'negative-short'
],
sounds: [],
muted: false
};
/**
* Setup defined sounds
*
* @return {boolean} True if setup was successfull, otherwise false
*/
SoundEffects.setup = function (libraryPath) {
if (!H5P.SoundJS.initializeDefaultPlugins()) {
return false;
}
H5P.SoundJS.alternateExtensions = ['mp3'];
for (var i = 0; i < SoundEffects.types.length; i++) {
var type = SoundEffects.types[i];
H5P.SoundJS.registerSound(libraryPath + 'sounds/' + type + '.ogg', type);
}
return true;
};
/**
* Play a sound
*
* @param {string} type Name of the sound as defined in [SoundEffects.types]{@link H5P.SoundEffects.SoundEffects#types}
* @param {number} delay Delay in milliseconds
*/
SoundEffects.play = function (type, delay) {
if (SoundEffects.muted === false) {
H5P.SoundJS.play(type, H5P.SoundJS.INTERRUPT_NONE, (delay || 0));
}
};
/**
* Mute. Subsequent invocations of SoundEffects.play() will not make any sounds beeing played.
*/
SoundEffects.mute = function () {
SoundEffects.muted = true;
};
/**
* Unmute
*/
SoundEffects.unmute = function () {
SoundEffects.muted = false;
};
return SoundEffects;
})();
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists