private void LoadSettings() { try { cboVoice.SelectedItem = LibIni.IniReadValue("Speech", "Voice"); } catch (Exception) { } try { barRate.Value = Convert.ToInt32(LibIni.IniReadValue("Speech", "Rate")); } catch (Exception) { barRate.Value = synth.Rate; } try { barVolumn.Value = Convert.ToInt32(LibIni.IniReadValue("Speech", "Volumn")); } catch (Exception) { barVolumn.Value = synth.Volume; } try { txtFolder.Text = LibIni.IniReadValue("Speech", "Folder"); } catch (Exception) { txtFolder.Text = System.Windows.Forms.Application.StartupPath + @"\Data\Sound"; } if (txtFolder.Text.Length == 0) { txtFolder.Text = System.Windows.Forms.Application.StartupPath + @"\Data\Sound"; } }
private void LoadSettings() { LibIni.path = System.Windows.Forms.Application.StartupPath + @"\Settings.ini"; try { synth.SelectVoice(LibIni.IniReadValue("Speech", "Voice")); } catch (Exception) { } try { synth.Rate = Convert.ToInt32(LibIni.IniReadValue("Speech", "Rate")); } catch (Exception) { } try { synth.Volume = Convert.ToInt32(LibIni.IniReadValue("Speech", "Volumn")); } catch (Exception) { } try { LibIni.IniReadValue("Speech", "Folder"); } catch (Exception) { } }
private void btnSave_Click(object sender, EventArgs e) { LibIni.IniWriteValue("Speech", "Voice", synth.Voice.Name); LibIni.IniWriteValue("Speech", "Volumn", barVolumn.Value.ToString()); LibIni.IniWriteValue("Speech", "Rate", barRate.Value.ToString()); LibIni.IniWriteValue("Speech", "Folder", txtFolder.Text); }