public bool Remove(TTSMessage message) { if (!_messages.Contains(message)) { return(false); } if (null == _parentTTS) { throw new InvalidOperationException("No associated Text-To-Speech subsystem for cancellation"); } _parentTTS.TTSInitialize(); vx_tts_status status = VivoxCoreInstance.vx_tts_cancel_utterance(_parentTTS.TTSManagerId, message.Key); if (TextToSpeech.IsNotTTSError(status)) { BeforeMessageRemoved?.Invoke(this, new ITTSMessageQueueEventArgs(message)); return(_messages.Remove(message)); } else { throw new VivoxApiException((int)status); } }