public bool Unsubscribe(IMicrophoneSubscriber listener) { if (listener == null) { throw new ArgumentNullException("listener"); } return(_subscribers.Remove(listener)); }
public void Subscribe(IMicrophoneSubscriber listener) { if (listener == null) { throw new ArgumentNullException("listener"); } _subscribers.Add(listener); }
public virtual void Subscribe([NotNull] IMicrophoneSubscriber listener) { if (listener == null) { throw new ArgumentNullException("listener"); } using (var subscriptions = _micSubscriptions.Lock()) { subscriptions.Value.Add(listener); Interlocked.Increment(ref _micSubscriptionCount); } }
public void Unsubscribe([NotNull] IMicrophoneSubscriber listener) { if (listener == null) { throw new ArgumentNullException("listener", "Cannot unsubscribe with a null listener"); } _audioListeners.Remove(listener); if (_preprocessor != null) { _preprocessor.Unsubscribe(listener); } }
public virtual bool Unsubscribe([NotNull] IMicrophoneSubscriber listener) { if (listener == null) { throw new ArgumentNullException("listener"); } using (var subscriptions = _micSubscriptions.Lock()) { var removed = subscriptions.Value.Remove(listener); if (removed) { Interlocked.Decrement(ref _micSubscriptionCount); } return(removed); } }
/// <summary> /// Unsubscribes from the stream of recorded audio data /// </summary> /// <param name="listener"></param> public void UnsubscribeFromRecordedAudio([NotNull] IMicrophoneSubscriber listener) { _capture.Unsubscribe(listener); }
public void SubcribeToRecordedAudio([NotNull] IMicrophoneSubscriber listener) { // Deprecated due to misspelling in the name on 2020-03-31 SubscribeToRecordedAudio(listener); }
/// <summary> /// Subscribes to the stream of recorded audio data /// </summary> /// <param name="listener"> /// The listener which is to receive microphone audio data. /// </param> public void SubscribeToRecordedAudio([NotNull] IMicrophoneSubscriber listener) { _capture.Subscribe(listener); }