Exemple #1
0
 /// <summary>
 /// Force the microphone capture system to be reset
 /// </summary>
 /// <remarks>This will destroy and recreate the microphone, preprocessor and encoder.</remarks>
 public void ResetMicrophoneCapture()
 {
     if (_capture != null)
     {
         _capture.ForceReset();
     }
 }
        private void OnApplicationPause(bool paused)
        {
            if (!_started)
            {
                return;
            }

            if (paused)
            {
                Log.Info("OnApplicationPause (Paused)");

                // if the coroutine to resume is still running kill it now
                if (_resumeCo != null)
                {
                    StopCoroutine(_resumeCo);
                }
                _resumeCo = null;

                // Pause audio recording
                _capture.Pause();

                // Suspend playback for all speakers.
                MuteAllRemoteVoices = true;
            }
            else
            {
                Log.Info("OnApplicationPause (Resumed)");

                // Force a capture pipeline reset to resume recording
                _capture.ForceReset();

                // Start a coroutine to resume now that the pause has ended
                if (_resumeCo != null)
                {
                    StopCoroutine(_resumeCo);
                }
                _resumeCo = StartCoroutine(CoResumePlayback());
            }
        }