Exemplo n.º 1
0
 private bool Equals(TTSMessage other)
 {
     return(ITTSVoice.Equals(Voice, other.Voice) && string.Equals(Text, other.Text) &&
            TTSDestination.Equals(Destination, other.Destination) &&
            TTSMessageState.Equals(State, other.State) && uint.Equals(NumConsumers, other.NumConsumers) &&
            double.Equals(Duration, other.Duration) && uint.Equals(Key, other.Key) &&
            ITextToSpeech.Equals(TTS, other.TTS));
 }
Exemplo n.º 2
0
        /// <summary>
        /// Creates a new TTS message in the NotEnqueued state.
        /// </summary>
        /// <param name="text">The text to be synthesized into speech.</param>
        /// <param name="name">The destination for this message.</param>
        /// <remarks>
        /// To synthesize this text into speech and inject it into the destination,
        /// use ILoginSession.TTS.Speak(), or ILoginSession.TTS.Messages.Enqueue().
        /// </remarks>
        public TTSMessage(string text, TTSDestination destination)
        {
            if (text.Length > VivoxCoreInstance.VX_TTS_CHARACTER_COUNT_LIMIT)
            {
                throw new ArgumentOutOfRangeException($"{GetType().Name}: {text.Length} exceeds the " +
                                                      $"{VivoxCoreInstance.VX_TTS_CHARACTER_COUNT_LIMIT} maximum characters allowed for input text");
            }

            _text         = text;
            _destination  = destination;
            _voice        = null;
            _state        = TTSMessageState.NotEnqueued;
            _numConsumers = 0;
            _duration     = 0.0;
            _key          = 0;
            _ttsSubSystem = null;
        }