2017-11-09 13:37:41 +00:00
|
|
|
var Class = require('../utils/Class');
|
2017-11-10 11:55:32 +00:00
|
|
|
var WebAudioSoundManager = require('./WebAudioSoundManager');
|
2017-11-09 13:37:41 +00:00
|
|
|
|
2017-11-10 12:05:29 +00:00
|
|
|
// Phaser.Loader.BaseSoundManager
|
2017-11-09 13:37:41 +00:00
|
|
|
|
2017-11-10 12:05:29 +00:00
|
|
|
var BaseSoundManager = new Class({
|
2017-11-09 13:37:41 +00:00
|
|
|
|
2017-11-10 11:55:32 +00:00
|
|
|
// TODO define sound manager interface
|
2017-11-09 13:37:41 +00:00
|
|
|
|
|
|
|
});
|
|
|
|
|
2017-11-10 12:05:29 +00:00
|
|
|
BaseSoundManager.create = function (game)
|
2017-11-09 13:37:41 +00:00
|
|
|
{
|
|
|
|
if ((game.config.audio && game.config.audio.noAudio)
|
|
|
|
|| (!game.device.Audio.webAudio && !game.device.Audio.audioData))
|
|
|
|
{
|
2017-11-10 12:05:29 +00:00
|
|
|
return new BaseSoundManager(game);
|
2017-11-09 13:37:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if(game.device.Audio.webAudio
|
|
|
|
&& !(game.config.audio && game.config.audio.disableWebAudio))
|
|
|
|
{
|
2017-11-10 11:55:32 +00:00
|
|
|
return new WebAudioSoundManager(game);
|
2017-11-09 13:37:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// TODO return HTML5 Audio sound manager
|
2017-11-10 12:05:29 +00:00
|
|
|
return new BaseSoundManager(game);
|
2017-11-09 13:37:41 +00:00
|
|
|
};
|
|
|
|
|
2017-11-10 12:05:29 +00:00
|
|
|
module.exports = BaseSoundManager;
|