Exemple #1
0
        public GothicPersonalAssistant(ISoundService soundService, ISpeechRecognizerService speechRecognizerService)
        {
            _soundService = soundService;
            InitializeComponent();
            SetAssistantIcon(SelectedAssistantId);
            commands = JsonConvert.DeserializeObject <CommandConfig>(File.ReadAllText(@"GothicAssistant/Commands.json"));
            speechRecognizerService.CreateNewSynthesizer(commands.Command.Select(x => x.CommandText).ToArray(), recognizer, Bezi, listener, DefaultSpeechRecognized, RecognizerSpeechRecognized, ListenerSpeechRecognize);

            dispatcherTimer.Tick    += dispatcherTimer_Tick;
            dispatcherTimer.Interval = new TimeSpan(0, 0, 1);
            dispatcherTimer.Start();
        }
Exemple #2
0
        public ClassicPersonalAssistant(ISpeechRecognizerService speechRecognizerService, IAssistantService assistantService)
        {
            _speechRecognizerService = speechRecognizerService;
            _assistantService        = assistantService;

            InitializeComponent();
            UpdateCommandsList();
            _speechRecognizerService.CreateNewSynthesizer(commands.Command.Where(x => !x.IsConfimation).Select(x => x.CommandText).ToArray(), recognizer, Sara, listener, DefaultSpeechRecognized, RecognizerSpeechRecognized, ListenerSpeechRecognize);

            dispatcherTimer.Tick    += dispatcherTimer_Tick;
            dispatcherTimer.Interval = new TimeSpan(0, 0, 1);
            dispatcherTimer.Start();
            Sara.SpeakAsync(Properties.Resources.SaraIntroduce);
            PrepareSystemTray();
            contextMenu.MenuItems[0].Enabled = false;
        }