public void setEnable ( boolean flag ) { if ( mEnabled == flag ) { return ; } mEnabled = flag ; if ( flag ) { mContext . registerDrawFrameListener ( this ) ; mContext . getApplication ( ) . getEventReceiver ( ) . addListener ( this ) ; mAudioEngine . resume ( ) ; } else { mContext . unregisterDrawFrameListener ( this ) ; mContext . getApplication ( ) . getEventReceiver ( ) . removeListener ( this ) ; mAudioEngine . pause ( ) ; } }
Enables or disables sound . When sound is disabled nothing is played but the audio sources remain intact .