/// <summary> /// The GetSpeech element is used to translate a callers voice into text. /// </summary> /// <param name="grammar">An XML file defining acceptable words and phrases that a user might say during the call.</param> /// <param name="action">A URL where the converted voice text will be forwarded.</param> /// <returns></returns> public static GetSpeech Create(string grammar, string action) { var speech = new GetSpeech(); speech.Grammar = grammar; speech.Action = action; return speech; }
/// <summary> /// The GetSpeech element is used to translate a callers voice into text. /// </summary> /// <param name="grammar">An XML file defining acceptable words and phrases that a user might say during the call.</param> /// <param name="action">A URL where the converted voice text will be forwarded.</param> /// <param name="method">Method used to request the action URL.</param> /// <param name="timeout">Amount of seconds GetSpeech should wait in silence before requesting the action URL.</param> /// <param name="playBeep">Specifies if a beep should playback to the caller when GetSpeech begins.</param> /// <returns></returns> public static GetSpeech Create(string grammar, string action, HttpMethod? method, long? timeout, bool? playBeep) { var speech = new GetSpeech(); speech.Grammar = grammar; speech.Action = action; speech.Method = method == null ? null : method.ToString(); speech.Timeout = timeout == null ? null : timeout.ToString(); speech.PlayBeep = playBeep == null ? null : playBeep.ToString().ToLower(); return speech; }
/// <summary> /// The GetSpeech element is used to translate a callers voice into text. /// </summary> /// <param name="speech">GetSpeech object.</param> /// <returns></returns> public Response GetSpeech(GetSpeech speech) { Elements.Add(speech); return this; }