File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11var Class = require ( '../utils/Class' ) ;
22var BaseSoundManager = require ( './BaseSoundManager' ) ;
3+ var WebAudioSound = require ( './WebAudioSound' ) ;
34// Phaser.Loader.WebAudioSoundManager
45var WebAudioSoundManager = new Class ( {
56 Extends : BaseSoundManager ,
67 initialize : function WebAudioSoundManager ( game ) {
8+ BaseSoundManager . call ( this , game ) ;
79 /**
810 * @property {AudioContext } context - The AudioContext being used for playback.
911 * @default
1012 */
1113 this . context = this . createAudioContext ( ) ;
12- BaseSoundManager . call ( this , game ) ;
1314 } ,
1415 createAudioContext : function ( ) {
1516 var audioConfig = this . game . config . audio ;
1617 if ( audioConfig && audioConfig . context ) {
1718 return audioConfig . context ;
1819 }
1920 return new ( window [ 'AudioContext' ] || window [ 'webkitAudioContext' ] ) ( ) ;
21+ } ,
22+ add : function ( key , config ) {
23+ var sound = new WebAudioSound ( this , key , config ) ;
24+ this . sounds . push ( sound ) ;
25+ return sound ;
2026 }
2127} ) ;
2228module . exports = WebAudioSoundManager ;
You can’t perform that action at this time.
0 commit comments