Пример #1
0
        public void ConfigureVoice(string title)
        {
            string             voicename = Globals.GetString(ActionSay.globalvarspeechvoice, "Default");
            string             volume    = Globals.GetString(ActionSay.globalvarspeechvolume, "Default");
            string             rate      = Globals.GetString(ActionSay.globalvarspeechrate, "Default");
            ConditionVariables effects   = new ConditionVariables(PersistentVariables.GetString(ActionSay.globalvarspeecheffects, ""), ConditionVariables.FromMode.MultiEntryComma);

            ExtendedAudioForms.SpeechConfigure cfg = new ExtendedAudioForms.SpeechConfigure();
            cfg.Init(AudioQueueSpeech, SpeechSynthesizer,
                     "Select voice synthesizer defaults", title, this.Icon,
                     null, false, false, AudioExtensions.AudioQueue.Priority.Normal, "", "",
                     voicename,
                     volume,
                     rate,
                     effects);

            if (cfg.ShowDialog(discoveryform) == DialogResult.OK)
            {
                SetPeristentGlobal(ActionSay.globalvarspeechvoice, cfg.VoiceName);
                SetPeristentGlobal(ActionSay.globalvarspeechvolume, cfg.Volume);
                SetPeristentGlobal(ActionSay.globalvarspeechrate, cfg.Rate);
                SetPeristentGlobal(ActionSay.globalvarspeecheffects, cfg.Effects.ToString());

                EDDConfig.Instance.DefaultVoiceDevice = AudioQueueSpeech.Driver.GetAudioEndpoint();
            }
        }
Пример #2
0
        public void ConfigureWave(string title)
        {
            string             volume  = Globals.GetString(ActionPlay.globalvarplayvolume, "60");
            ConditionVariables effects = new ConditionVariables(PersistentVariables.GetString(ActionPlay.globalvarplayeffects, ""), ConditionVariables.FromMode.MultiEntryComma);

            ExtendedAudioForms.WaveConfigureDialog dlg = new ExtendedAudioForms.WaveConfigureDialog();
            dlg.Init(AudioQueueWave, true,
                     "Select Default device, volume and effects", title, this.Icon,
                     "",
                     false, AudioExtensions.AudioQueue.Priority.Normal, "", "",
                     volume, effects);

            if (dlg.ShowDialog(discoveryform) == DialogResult.OK)
            {
                ConditionVariables cond = new ConditionVariables(dlg.Effects);// add on any effects variables (and may add in some previous variables, since we did not purge)

                SetPeristentGlobal(ActionPlay.globalvarplayvolume, dlg.Volume);
                SetPeristentGlobal(ActionPlay.globalvarplayeffects, dlg.Effects.ToString());

                EDDConfig.Instance.DefaultWaveDevice = AudioQueueWave.Driver.GetAudioEndpoint();
            }
        }