mirror of
https://github.com/photonstorm/phaser
synced 2024-12-20 10:03:50 +00:00
27 lines
792 B
JavaScript
27 lines
792 B
JavaScript
var WebAudioSoundManager = require('./webaudio/WebAudioSoundManager');
|
|
var HTML5AudioSoundManager = require('./html5/HTML5AudioSoundManager');
|
|
var NoAudioSoundManager = require('./noaudio/NoAudioSoundManager');
|
|
|
|
var SoundManagerCreator = {
|
|
|
|
create: function (game)
|
|
{
|
|
var audioConfig = game.config.audio;
|
|
var deviceAudio = game.device.Audio;
|
|
|
|
if ((audioConfig && audioConfig.noAudio) || (!deviceAudio.webAudio && !deviceAudio.audioData))
|
|
{
|
|
return new NoAudioSoundManager(game);
|
|
}
|
|
|
|
if(deviceAudio.webAudio && !(audioConfig && audioConfig.disableWebAudio))
|
|
{
|
|
return new WebAudioSoundManager(game);
|
|
}
|
|
|
|
return new HTML5AudioSoundManager(game);
|
|
}
|
|
|
|
};
|
|
|
|
module.exports = SoundManagerCreator;
|