private void InitializeService(LanguageConfig conf) { var lang = SupportedLanguage.FromLanguageTag(conf.LanguageCode); var config = new AIConfiguration("62f2522a-7404-4c28-b9ac-097ca5d8b32d", conf.AccessToken, lang); //TODO: Option for verbose logging. Remove this line in production. config.DebugLog = true; if (aiService != null) { aiService.Cancel(); } aiService = AIService.CreateService(config); aiService.OnResult += AiService_OnResult; aiService.OnError += AiService_OnError; aiService.ListeningStarted += AiService_ListeningStarted; aiService.ListeningFinished += AiService_ListeningFinished; aiService.AudioLevelChanged += AiService_AudioLevelChanged; }