mirror of
https://github.com/photonstorm/phaser
synced 2024-12-21 02:23:29 +00:00
28 lines
814 B
JavaScript
28 lines
814 B
JavaScript
var BaseSoundManager = require('./BaseSoundManager');
|
|
var WebAudioSoundManager = require('./webaudio/WebAudioSoundManager');
|
|
|
|
var SoundManagerCreator = {
|
|
|
|
create: function (game)
|
|
{
|
|
var audioConfig = game.config.audio;
|
|
var deviceAudio = game.device.Audio;
|
|
|
|
if ((audioConfig && audioConfig.noAudio) || (!deviceAudio.webAudio && !deviceAudio.audioData))
|
|
{
|
|
// TODO add no audio implementation of BaseSoundManager
|
|
return new BaseSoundManager(game);
|
|
}
|
|
|
|
if(deviceAudio.webAudio && !(audioConfig && audioConfig.disableWebAudio))
|
|
{
|
|
return new WebAudioSoundManager(game);
|
|
}
|
|
|
|
// TODO return HTML5 Audio sound manager
|
|
return new BaseSoundManager(game);
|
|
}
|
|
|
|
};
|
|
|
|
module.exports = SoundManagerCreator;
|