Exemple #1
0
 public static DrivingHandler GetHandler()
 {
     if (instance == null)
     {
         instance = new DrivingHandler();
     }
     return(instance);
 }
Exemple #2
0
        public VRHandler(Label label, ActivityIndicator indicator)
        {
            micService = DependencyService.Resolve <IMicrophoneService>();

            this.bleHandler     = BLEHandler.GetHandler();
            this.drivingHandler = DrivingHandler.GetHandler();

            this.lText     = label;
            this.indicator = indicator;

            // initialize speech recognizer
            if (recognizer == null)
            {
                var config = SpeechConfig.FromSubscription(Constants.CognitiveServicesApiKey, Constants.CognitiveServicesRegion);
                //string[] languages = { "cs-CZ", "en-US", "en-GB" };
                AutoDetectSourceLanguageConfig lang_config = AutoDetectSourceLanguageConfig.FromLanguages(Constants.GetLanguages);
                recognizer             = new SpeechRecognizer(config, lang_config);
                recognizer.Recognized += (obj, args) =>
                {
                    Process(args.Result.Text);
                };
            }
        }