/// <summary> /// Initializes a new instance of SapiSpeechGenerator /// </summary> public Loq7SpeechGenerator() { this.selectedVoiceName = String.Empty; try { speechSynth = new LTTS7Class(); } catch { speechSynth = null; } LoadVoices(); }
/// <summary> /// Converts the TTS generated from provided text to a wavefile /// </summary> /// <param name="textToSay">Text to speech out</param> /// <param name="path">Path of the file to save waveform</param> /// <returns>true if file was generated successfully</returns> public override bool SaveTextToWav(string textToSay, string path) { LTTS7Class synth; textToSay = textToSay.Replace("robot", "row-bought"); //textToSay = Regex.Replace(textToSay, "robot", "row-bought", RegexOptions.IgnoreCase); //textToSay = Regex.Replace(textToSay, "robot", "robought", RegexOptions.IgnoreCase); try { synth = new LTTS7Class(); synth.Voice = selectedVoiceName; synth.Record(textToSay, path); return(true); } catch { return(false); } }
/// <summary> /// Converts the TTS generated from provided text to a wavefile /// </summary> /// <param name="textToSay">Text to speech out</param> /// <param name="path">Path of the file to save waveform</param> /// <returns>true if file was generated successfully</returns> public override bool SaveTextToWav(string textToSay, string path) { LTTS7Class synth; textToSay = textToSay.Replace("robot", "row-bought"); //textToSay = Regex.Replace(textToSay, "robot", "row-bought", RegexOptions.IgnoreCase); //textToSay = Regex.Replace(textToSay, "robot", "robought", RegexOptions.IgnoreCase); try { synth = new LTTS7Class(); synth.Voice = selectedVoiceName; synth.Record(textToSay, path); return true; } catch { return false; } }