2017-11-17 13:17:59 +00:00
|
|
|
var WebAudioSoundManager = require('./webaudio/WebAudioSoundManager');
|
2018-01-11 16:29:57 +00:00
|
|
|
var HTML5AudioSoundManager = require('./html5/HTML5AudioSoundManager');
|
2018-01-20 20:23:43 +00:00
|
|
|
var NoAudioSoundManager = require('./noaudio/NoAudioSoundManager');
|
2017-11-10 18:05:26 +00:00
|
|
|
|
|
|
|
var SoundManagerCreator = {
|
|
|
|
|
|
|
|
create: function (game)
|
|
|
|
{
|
|
|
|
var audioConfig = game.config.audio;
|
|
|
|
var deviceAudio = game.device.Audio;
|
|
|
|
|
|
|
|
if ((audioConfig && audioConfig.noAudio) || (!deviceAudio.webAudio && !deviceAudio.audioData))
|
|
|
|
{
|
2018-01-20 20:23:43 +00:00
|
|
|
return new NoAudioSoundManager(game);
|
2017-11-10 18:05:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if(deviceAudio.webAudio && !(audioConfig && audioConfig.disableWebAudio))
|
|
|
|
{
|
|
|
|
return new WebAudioSoundManager(game);
|
|
|
|
}
|
|
|
|
|
2018-01-11 16:29:57 +00:00
|
|
|
return new HTML5AudioSoundManager(game);
|
2017-11-10 18:05:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = SoundManagerCreator;
|