예제 #1
0
 /// <summary>
 /// Clears this instance.
 /// </summary>
 private void Clear()
 {
     if (_audioQueue != null)
     {
         _audioQueue.Stop(true);
         _audioQueue.InputCompleted -= QueueInputCompleted;
         _audioQueue.Dispose();
         _audioQueue = null;
     }
 }
예제 #2
0
 public void Dispose()
 {
     Stop();
     foreach (var ptr in _bufferPtrs)
     {
         _audioQueue.FreeBuffer(ptr);
     }
     _audioQueue.QueueDispose();
     _audioQueue.Dispose();
 }
예제 #3
0
        public void Dispose()
        {
            _isRecording = false;

            _queue.Stop(true);
            _audioFile.Dispose();
            _queue.Dispose();

            _queue     = null;
            _audioFile = null;
        }
예제 #4
0
 public void Dispose()
 {
     Stop();
     _subject.OnCompleted();
     foreach (var ptr in bufferPtrs)
     {
         audioQueue.FreeBuffer(ptr);
     }
     audioQueue.QueueDispose();
     audioQueue.Dispose();
     _subject.Dispose();
 }
예제 #5
0
        /// <summary>
        /// Stops the audio stream.
        /// </summary>
        public Task Stop()
        {
            if (audioQueue != null)
            {
                audioQueue.InputCompleted -= QueueInputCompleted;

                if (audioQueue.IsRunning)
                {
                    BufferOperation(() => audioQueue.Stop(true),
                                    () => OnActiveChanged?.Invoke(this, false),
                                    status => Debug.WriteLine("AudioStream.Stop() :: audioQueue.Stop returned non OK result: {0}", status));
                }

                audioQueue.Dispose();
                audioQueue = null;
            }

            return(Task.FromResult(true));
        }
예제 #6
0
        /// <summary>
        /// Stops the audio stream.
        /// </summary>
        public Task Stop()
        {
            audioQueue.InputCompleted -= QueueInputCompleted;

            var result = audioQueue.Stop(true);

            audioQueue.Dispose();
            audioQueue = null;

            if (result == AudioQueueStatus.Ok)
            {
                OnActiveChanged?.Invoke(this, false);
            }
            else
            {
                System.Diagnostics.Debug.WriteLine("AudioStream.Stop() :: audioQueue.Stop returned non OK result: {0}", result);
            }

            return(Task.FromResult(true));
        }