public CommunicationController(ICommunicationSvc commSvc,
                                IConfiguration config, IHubContext <PrattleHub> prattleHub) : base(config)
 {
     Log.Information("CommunicationController Constructor");
     _commSvc    = commSvc;
     _prattleHub = prattleHub;
 }
        public CommunicationSvc(IConfigSvc configSvc, ICommunicationSvc communicationSvc)
        {
            _configSvc              = configSvc;
            _communicationSvc       = communicationSvc;
            _reader                 = new SpeechSynthesizer();
            _recognizer             = new SpeechRecognitionEngine();
            _reader.SpeakStarted   += _reader_SpeakStarted;
            _reader.SpeakProgress  += _reader_SpeakProgress;
            _reader.SpeakCompleted += _reader_SpeakCompleted;
            _helper                 = CommunicationHelper.CommunicationObject;
            _userCommand            = string.Empty;

            _completed = new ManualResetEvent(false);
            _recognizer.SpeechRecognitionRejected += _recognizer_SpeechRecognitionRejected;
            _recognizer.SpeechRecognized          += _recognizer_SpeechRecognized;
            _recognizer.SetInputToDefaultAudioDevice(); // set the input of the speech recognizer to the default audio device
            _recognizer.RecognizeAsync(RecognizeMode.Multiple);
            _completed.WaitOne();                       // wait until speech recognition is completed
        }
 public PrattleHub(ICommunicationSvc commSvc)
 {
     this._commSvc = commSvc;
 }