/// <summary> /// Clears this instance. /// </summary> private void Clear() { if (_audioQueue != null) { _audioQueue.Stop(true); _audioQueue.InputCompleted -= QueueInputCompleted; _audioQueue.Dispose(); _audioQueue = null; } }
public void Dispose() { Stop(); foreach (var ptr in _bufferPtrs) { _audioQueue.FreeBuffer(ptr); } _audioQueue.QueueDispose(); _audioQueue.Dispose(); }
public void Dispose() { _isRecording = false; _queue.Stop(true); _audioFile.Dispose(); _queue.Dispose(); _queue = null; _audioFile = null; }
public void Dispose() { Stop(); _subject.OnCompleted(); foreach (var ptr in bufferPtrs) { audioQueue.FreeBuffer(ptr); } audioQueue.QueueDispose(); audioQueue.Dispose(); _subject.Dispose(); }
/// <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)); }
/// <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)); }