/// <summary> /// Opens the synth-player. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void click_Synth(object sender, EventArgs e) { tb_text.Text = TypedText.SanitizeTypedText(tb_text.Text); bu_synth.Enabled = false; var synth = new VoiceSynthF(this, tb_text.Text); synth.Show(this); }
/// <summary> /// Plays the audio-file. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void click_Play(object sender, EventArgs e) { tb_text.Text = TypedText.SanitizeTypedText(tb_text.Text); using (var fs = new FileStream(_sapi.Wavefile, FileMode.Open, FileAccess.Read, FileShare.Read)) using (var player = new SoundPlayer(fs)) { player.SoundLocation = _sapi.Wavefile; player.Play(); } }
/// <summary> /// Loads a user-prepared file w/ typed-text. /// </summary> /// <returns></returns> string LoadTypedTextFile() { string file = _pfe.Substring(0, _pfe.Length - 3) + EXT_TXT; if (File.Exists(file)) { using (var sr = new StreamReader(file)) { return(TypedText.SanitizeTypedText(sr.ReadToEnd())); } } return(String.Empty); }
/// <summary> /// Generates data for an FXE file. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void click_Generate(object sender, EventArgs e) { #if DEBUG logfile.Log(); logfile.Log(); logfile.Log("click_Generate() ==============================================================="); #endif Cursor = Cursors.WaitCursor; // shall return to Default cursor either OnSrStreamEnded() or an InfoDialog error. tb_text.Text = TypedText.SanitizeTypedText(tb_text.Text); Clear(); _sapi.Start(tb_text.Text); }
/// <summary> /// Sets the typed-text when Ok is clicked in the VoiceSynthesizer /// dialog. /// </summary> /// <param name="text"></param> internal void SetText(string text) { tb_text.Text = TypedText.SanitizeTypedText(text); }