phaser/v3/src/sound/SoundManager.js

31 lines
717 B
JavaScript
Raw Normal View History

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
// Phaser.Loader.SoundManager
var SoundManager = new Class({
2017-11-10 11:55:32 +00:00
// TODO define sound manager interface
2017-11-09 13:37:41 +00:00
});
SoundManager.create = function (game)
{
if ((game.config.audio && game.config.audio.noAudio)
|| (!game.device.Audio.webAudio && !game.device.Audio.audioData))
{
return new SoundManager(game);
}
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
return new SoundManager(game);
};
module.exports = SoundManager;