Example #1
0
 private void ResovleTypes()
 {
     m_riffSystemOperations    = Bootstrapper.ResolveType <RiffSystemOperations>();
     m_greetings               = Bootstrapper.ResolveType <Greetings>();
     m_speechHandlerChain      = Bootstrapper.ResolveType <ISpeechHandlerChain>();
     m_speechContext           = Bootstrapper.ResolveType <ISpeechContext>();
     m_speechRecognitionEngine = Bootstrapper.ResolveType <IRecognitionEngineProvider>();
 }
 public GoogleRecognitionEngineProvider(IMicrophoneContext microphoneContext, ISpeechHandlerChain speechHandlerChain)
 {
     try
     {
         m_client            = SpeechClient.Create();
         m_microphoneContext = microphoneContext;
         m_bytesPerSecond    = m_microphoneContext.SampleRate() *
                               m_microphoneContext.ChannelCount() *
                               m_microphoneContext.BytesPerSample();
         m_speechHandlerChain        = speechHandlerChain;
         m_streamingRecognizeRequest = CreateStreamingRecognizeRequest();
     }
     catch (Exception e)
     {
         Console.WriteLine(e.ToString());
     }
 }