@@ -1601,19 +1601,22 @@ cc.WebAudioEngine = cc.AudioEngine.extend(/** @lends cc.WebAudioEngine# */{
16011601 audioID = this . _audioID ++ ;
16021602 this . _audioIDList [ audioID ] = addSFX ;
16031603 return audioID ;
1604-
16051604 } else if ( this . isFormatSupported ( extName ) && ! ( keyName in this . _audiosLoading ) ) {
16061605 // load now only if the type is supported and it is not being loaded currently
16071606 this . _audiosLoading [ keyName ] = true ;
16081607 var engine = this ;
1609-
16101608 audioID = this . _audioID ++ ;
16111609 this . _audioIDList [ audioID ] = null ;
16121610 this . _fetchData ( path , function ( buffer ) {
16131611 // resource fetched, save it and call playEffect() again, this time it should be alright
16141612 engine . _audioData [ keyName ] = buffer ;
16151613 delete engine . _audiosLoading [ keyName ] ;
1616- engine . _audioIDList [ audioID ] = engine . _beginSound ( keyName , loop , engine . getEffectsVolume ( ) ) ;
1614+ var asynSFX = engine . _beginSound ( keyName , loop , engine . getEffectsVolume ( ) ) ;
1615+ engine . _audioIDList [ audioID ] = asynSFX ;
1616+ var locEffects = engine . _effects ;
1617+ if ( ! ( keyName in locEffects ) )
1618+ locEffects [ keyName ] = [ ] ;
1619+ locEffects [ keyName ] . push ( asynSFX ) ;
16171620 } , function ( ) {
16181621 // resource fetching failed, doing nothing here
16191622 delete engine . _audiosLoading [ keyName ] ;
0 commit comments