private void Sfe_TestSettingEvent(SoundEffectsDialog sfe, Variables effects) { System.IO.MemoryStream ms = synth.Speak(textBoxBorderTest.Text, "Default", comboBoxCustomVoice.Text, trackBarRate.Value); if (ms != null) { AudioQueue.AudioSample a = queue.Generate(ms, new SoundEffectSettings(effects)); a.sampleOverEvent += SampleOver; a.sampleOverTag = sfe; queue.Submit(a, trackBarVolume.Value, AudioQueue.Priority.High); } }
private void buttonExtEffects_Click(object sender, EventArgs e) { SoundEffectsDialog sfe = new SoundEffectsDialog(); sfe.Init(this.Icon, effects, true); sfe.TestSettingEvent += Sfe_TestSettingEvent; // callback to say test sfe.StopTestSettingEvent += Sfe_StopTestSettingEvent; // callback to say stop if (sfe.ShowDialog(this) == DialogResult.OK) { effects = sfe.GetEffects(); } }
private void buttonExtEffects_Click(object sender, EventArgs e) { SoundEffectsDialog sfe = new SoundEffectsDialog(); sfe.Init(this.Icon, effects, textBoxBorderText.Visible); // give them the none option ONLY if we are allowing text sfe.TestSettingEvent += Sfe_TestSettingEvent; // callback to say test sfe.StopTestSettingEvent += Sfe_StopTestSettingEvent; // callback to say stop if (sfe.ShowDialog(this) == DialogResult.OK) { effects = sfe.GetEffects(); } }
private void Sfe_TestSettingEvent(SoundEffectsDialog sfe, Variables effects) { try { AudioQueue.AudioSample a = queue.Generate(textBoxBorderText.Text, new SoundEffectSettings(effects)); a.sampleOverEvent += SampleOver; a.sampleOverTag = sfe; queue.Submit(a, trackBarVolume.Value, AudioQueue.Priority.High); } catch { ExtendedControls.MessageBoxTheme.Show(this, "Unable to play " + textBoxBorderText.Text); } }
private void SampleOver(AudioQueue s, Object tag) { SoundEffectsDialog sfe = tag as SoundEffectsDialog; sfe.TestOver(); }
private void Sfe_StopTestSettingEvent(SoundEffectsDialog sender) { queue.StopCurrent(); }