mirror of
https://github.com/photonstorm/phaser
synced 2024-11-24 13:43:26 +00:00
added SoundManager class
This commit is contained in:
parent
8c0eaf3b69
commit
2dff3dd1be
2 changed files with 38 additions and 1 deletions
35
v3/src/sound/SoundManager.js
Normal file
35
v3/src/sound/SoundManager.js
Normal file
|
@ -0,0 +1,35 @@
|
|||
var Class = require('../utils/Class');
|
||||
|
||||
// Phaser.Loader.SoundManager
|
||||
|
||||
var SoundManager = new Class({
|
||||
|
||||
initialize:
|
||||
|
||||
function SoundManager (game)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
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))
|
||||
{
|
||||
// TODO create Web Audio sound manager
|
||||
return new SoundManager(game);
|
||||
}
|
||||
|
||||
// TODO return HTML5 Audio sound manager
|
||||
return new SoundManager(game);
|
||||
};
|
||||
|
||||
module.exports = SoundManager;
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
module.exports = {
|
||||
|
||||
Dynamic: require('./dynamic')
|
||||
Dynamic: require('./dynamic'),
|
||||
|
||||
SoundManager: require('./SoundManager')
|
||||
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue