Exemple #1
0
 /// <summary>
 /// Sets up member variables.
 /// </summary>
 public TTSEngine()
 {
     speechSynthesizer = new SpeechSynthesizer();
     hotkeyRegistry    = new HotkeyRegistry();
     inputSimulator    = new InputSimulator();
     settingsRepo      = new SettingsRepo();
     speechSynthesizer.SetOutputToDefaultAudioDevice();
     if (!settingsRepo.SettingsExists())
     {
         string[] installedVoices = GetInstalledVoices();
         if (installedVoices.Length == 0)
         {
             throw new DependentPlatformMissingException("No installed voices found.");
         }
         settingsRepo.Create(new SettingsFile(new Hotkey(ModifierKey.CTRL, Keys.Space), installedVoices[0], true, new List <VoiceBindingEntity>()));
     }
     ReloadSettings();
 }