Exemplo n.º 1
0
        /// <summary>
        /// Stops the audio stream.
        /// </summary>
        public Task Stop()
        {
            if (Active)
            {
                Active = false;

                outputNode?.Stop();
                audioGraph?.Stop();

                OnActiveChanged?.Invoke(this, false);
            }

            outputNode?.Dispose();
            outputNode = null;

            if (audioGraph != null)
            {
                audioGraph.QuantumStarted             -= Graph_QuantumStarted;
                audioGraph.UnrecoverableErrorOccurred -= Graph_UnrecoverableErrorOccurred;
                audioGraph.Dispose();
                audioGraph = null;
            }

            return(Task.CompletedTask);
        }
Exemplo n.º 2
0
        public void Dispose()
        {
            _InputNode.Dispose();
            _FrameOutputNode.Dispose();
            _MicCaptureDeviceWatcher.Stop();

            StopAudioInput().ConfigureAwait(false);
        }
Exemplo n.º 3
0
 protected override void OnNavigatedFrom(NavigationEventArgs args)
 {
     if (pin != IntPtr.Zero)
     {
         FFTWSharp.fftwf.free(pin);
         pin = IntPtr.Zero;
     }
     if (pout != IntPtr.Zero)
     {
         FFTWSharp.fftwf.free(pout);
         pout = IntPtr.Zero;
     }
     if (fplan != IntPtr.Zero)
     {
         FFTWSharp.fftwf.destroy_plan(fplan);
         fplan = IntPtr.Zero;
     }
     this.m_AudioGraph.Stop();
     m_AudioFrameOutputNode.Dispose();
     m_AudioDevideInputNode.Dispose();
     m_AudioGraph.Dispose();
     base.OnNavigatedFrom(args);
 }