コード例 #1
0
        private void _initControlls()
        {
            _settingsequalizer = SettingsEqualizer.GetSettings();

            GetInstalVoicesToComboVoices();

            initionSliders();
            initionSpeed();
            initionVolume();
            initionPause();
        }
コード例 #2
0
        public static SettingsEqualizer GetSettings()
        {
            SettingsEqualizer formsett = null;
            string            filename = Globals.SettingsFileEqulizer;

            if (File.Exists(filename))
            {
                using (FileStream fs = new FileStream(filename, FileMode.Open))
                {
                    XmlSerializer xser = new XmlSerializer(typeof(SettingsEqualizer));
                    formsett = (SettingsEqualizer)xser.Deserialize(fs);
                    fs.Close();
                }
            }
            else
            {
                formsett = new SettingsEqualizer();
            }
            return(formsett);
        }
コード例 #3
0
        private void AllReadersLoadVoice()
        {
            ReaderOriginal     = new SpeechSynthesizer();
            _settingsEqualizer = SettingsEqualizer.GetSettings();

            try
            {
                ReaderOriginal.SelectVoice(_settingsEqualizer.VoiceName);
            }
            catch (Exception ex)
            {
                if (Voices.Count != 0)
                {
                    ReaderOriginal.SelectVoice(Voices[0].Name);
                    MessageBox.Show(Massage(ex), Globals.ERR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    throw new Exception("None instaled voices");
                }
            }
        }