From e0a41d3107799bcfa9af1b8ef0837da5c97ad436 Mon Sep 17 00:00:00 2001 From: Chris Schraer Date: Fri, 21 Jul 2023 12:26:29 -0700 Subject: [PATCH 1/7] rebased changes from previous --- src/app/macaroni_app.csproj | 2 +- ...mbeddedIntentTriggerCommandSetExtension.cs | 208 ++++++++++++++++++ src/cs/CommandSystem/CommandSystem.cs | 3 +- .../IntentRecognizerService.cs | 19 ++ src/cs/Interfaces/IIntentRecognizerService.cs | 6 +- src/cs/Tests/test-example-atis.mac | 53 +++++ src/cs/Tests/test-example-atis_airfare.mac | 22 ++ src/cs/Tests/test-example-atis_meal.mac | 17 ++ src/cs/macaroni_core.csproj | 2 +- src/macaroni_api_c/macaroni_api_c.csproj | 4 - src/maui/MauiProgram.cs | 6 +- src/maui/maui.csproj | 8 +- src/mr/mr.csproj | 2 +- 13 files changed, 338 insertions(+), 14 deletions(-) create mode 100644 src/cs/Command/Triggers/EmbeddedIntentTriggerCommandSetExtension.cs create mode 100644 src/cs/Tests/test-example-atis.mac create mode 100644 src/cs/Tests/test-example-atis_airfare.mac create mode 100644 src/cs/Tests/test-example-atis_meal.mac diff --git a/src/app/macaroni_app.csproj b/src/app/macaroni_app.csproj index c37138be..831c26fe 100644 --- a/src/app/macaroni_app.csproj +++ b/src/app/macaroni_app.csproj @@ -2,7 +2,7 @@ - 1.29 + 1.30.0-alpha.0.37839940 false WinExe diff --git a/src/cs/Command/Triggers/EmbeddedIntentTriggerCommandSetExtension.cs b/src/cs/Command/Triggers/EmbeddedIntentTriggerCommandSetExtension.cs new file mode 100644 index 00000000..69aff62f --- /dev/null +++ b/src/cs/Command/Triggers/EmbeddedIntentTriggerCommandSetExtension.cs @@ -0,0 +1,208 @@ +using System.Linq; +using System.Text; +using macaroni.DataTypes; +using Microsoft.CognitiveServices.Speech; +using Microsoft.CognitiveServices.Speech.Intent; +using static macaroni.HotkeyTriggerCommandSetExtension; + +namespace macaroni; + +internal class EmbeddedIntentTriggerCommandSetExtension : ICommandSetExtension, INotifyCondition, INotifyYamlValues +{ + public void InitCommandSetExtension(ICommandSet commandSet) + { + _commandSet = commandSet; + _commandExecutionService = _commandSet?.GetParentOrService(); + + _recognizer = _commandSet?.GetParentOrService(); + _intentGroupId = _commandSet?.Id + "intents" ?? ""; + } + + public void EnableExtension(bool enabled) + { + if (enabled) + { + ReloadEmbeddedLUModel(); + RegisterCallbacks(); + } + else + { + RemoveIntentCallbacks(); + } + } + + public void ValueChanged(IYamlValue value) + { + MR.DBG_TRACE_INFO($"IntentTriggerCommandSetExtension::ValueChanged({value.GetType().Name})"); + ReloadEmbeddedLUModel(); + RegisterCallbacks(); + MR.DBG_TRACE_INFO($"IntentTriggerCommandSetExtension::ValueChanged({value.GetType().Name}) ... Done!"); + } + + public void ConditionChanged(ICondition condition) + { + MR.DBG_TRACE_INFO($"IntentTriggerCommandSetExtension::ConditionChanged({condition.GetType().Name})"); + ReloadEmbeddedLUModel(); + RegisterCallbacks(); + MR.DBG_TRACE_INFO($"IntentTriggerCommandSetExtension::ConditionChanged({condition.GetType().Name}) ... Done!"); + } + + private void RegisterCallbacks() + { + _recognizer?.RemoveIntentCallbackGroup(_intentGroupId); + + List intentTriggers = new List(); + + foreach (var command in _commandSet?.Commands ?? Enumerable.Empty()) + { + if (command.Triggers == null) continue; + if (!command.IsSatisfied()) continue; + + var triggers = command.Triggers.ToList(); + + if (command.Expecting != null) + { + triggers.AddRange(command.Expecting); + } + + foreach (var trigger in triggers) + { + var intentTrigger = trigger as IIntentTrigger; + if (intentTrigger != null) + { + _recognizer?.RegisterIntentCallback(intentTrigger.IntentId, intentTrigger.EntityId, _intentGroupId, x => InvokeCommand(x)); + } + } + } + } + + private void ReloadEmbeddedLUModel() + { + if (_model != null) + { + _recognizer?.UnloadEmbeddedLUModel(_model); + _model = null; + } + LoadEmbeddedLUModel(_recognizer); + } + + private void LoadEmbeddedLUModel(IIntentRecognizerService? recognizer) + { + var model = CreateEmbeddedLUModel(); + if (model != null) + { + recognizer?.LoadEmbeddedLUModel(model); + } + } + + private EmbeddedLanguageUnderstandingModel? CreateEmbeddedLUModel() + { + var satisfied = _commandSet?.Conditions?.IsSatisfied(); + if (satisfied != null && !satisfied.Value) return null; + var settings = _commandSet?.GetRequiredParentOrService(); + + var modelId = _commandSet?.Id; + + string?[] embeddedPaths = { + settings?.Get("EMBEDDED_LANGUAGE_UNDERSTANDING_MODEL_PATH", "") + }; + var pathsOk = embeddedPaths.All(x => !string.IsNullOrEmpty(x)); // nateko + var luModelPath = settings.Get("EMBEDDED_LANGUAGE_UNDERSTANDING_MODEL_PATH", ""); + if (!string.IsNullOrEmpty(luModelPath)) + { + var luIniConfig = System.IO.Path.Combine(luModelPath, "lu.ini"); + var luModel = EmbeddedLanguageUnderstandingModel.FromIniFile(luIniConfig, ""); + return luModel; + } + return null; + } + + private void RemoveIntentCallbacks() + { + _recognizer?.RemoveIntentCallbackGroup(_intentGroupId); + } + + private void InvokeCommand(IntentResult result) + { + MR.DBG_TRACE_INFO($"--- INVOKING COMMAND: {result.IntentId}"); + + var command = GetCommand(result); + _commandExecutionService?.Execute(command, context => RegisterResolver(context, result)); + + MR.DBG_TRACE_INFO($"- INVOKING COMMAND: {result.IntentId} ... Done!\n"); + } + + private ICommand? GetCommand(IntentResult result) + { + return _commandSet?.Commands?.FirstOrDefault(command => + { + return null != command?.Expecting?.FirstOrDefault(trigger => FindMatchingTrigger(result, trigger)) || + null != command?.Triggers?.FirstOrDefault(trigger => FindMatchingTrigger(result, trigger)); + }); + } + + private static bool FindMatchingTrigger(IntentResult result, ICommandTrigger? trigger) + { + var intentTrigger = trigger as IIntentTrigger; + + var intentOk = intentTrigger != null && intentTrigger.IntentId == result.IntentId; + if (!intentOk) return false; + + var entityOk = intentTrigger!.EntityId == null || result.Entities.ContainsKey(intentTrigger.EntityId); + if (!entityOk) return false; + + return true; + } + + private void RegisterResolver(IExecutionContext context, IntentResult result) + { + context.RegisterResolver( + nameof(IntentTriggerCommandSetExtension), + name => ResolveContext(result, name)); + } + + private object? ResolveContext(IntentResult result, string name) + { + if (name == "context.keys") return string.Join('\n', + new string[] { + "trigger.type", + "intent.trigger", + "result.intentId", + "result.text" + } + .Concat(result.Entities.Keys) + .Concat(result.Entities.Keys + .Select(x => $"{x}.json") + .Where(x => TryGetCluEntityJson(result, x, out var json))) + ); + + if (name == "trigger.type") return "intent"; + if (name == "intent.trigger") return result.IntentId; + if (name == "result.intentId") return result.IntentId; + if (name == "result.text") return result.IntentRecognitionResult.Text; + + if (result.Entities.ContainsKey(name)) return result.Entities[name]; + if (result.Entities.ContainsKey($"{name}*")) return result.Entities[$"{name}*"]; + if (name.EndsWith(".json") && TryGetCluEntityJson(result, name, out var json)) return json; + + var value = result.IntentRecognitionResult.Properties.GetProperty(name); + if (!string.IsNullOrEmpty(value)) return value; + + return null; + } + + private bool TryGetCluEntityJson(IntentResult result, string name, out string? json) + { + json = null; + var check = name.Substring(0, name.Length - ".json".Length); + return result.Entities.ContainsKey(check) && + result.EntitiesJson != null && + result.EntitiesJson.TryGetValue(check, out json); + } + + private ICommandSet? _commandSet; + private ICommandExecutionService? _commandExecutionService; + private EmbeddedLanguageUnderstandingModel? _model; + private IIntentRecognizerService? _recognizer; + private string _intentGroupId = ""; +} diff --git a/src/cs/CommandSystem/CommandSystem.cs b/src/cs/CommandSystem/CommandSystem.cs index c1e69792..52e96ee7 100644 --- a/src/cs/CommandSystem/CommandSystem.cs +++ b/src/cs/CommandSystem/CommandSystem.cs @@ -72,7 +72,8 @@ public static ICommandSystemBuilder CreateBuilder() // conditions/triggers/executor extensions services.AddTransient(); - services.AddTransient(); + //services.AddTransient(); + services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); diff --git a/src/cs/IntentRecognition/IntentRecognizerService.cs b/src/cs/IntentRecognition/IntentRecognizerService.cs index db140b47..290ac171 100644 --- a/src/cs/IntentRecognition/IntentRecognizerService.cs +++ b/src/cs/IntentRecognition/IntentRecognizerService.cs @@ -197,6 +197,25 @@ public void Emulate(string text) WaitForever(recognizer.RecognizeOnceAsync(text)); } + public void UnloadEmbeddedLUModel(EmbeddedLanguageUnderstandingModel model) + { + lock (_models) + { + _models.Remove(model.ModelId); + } + } + + public void LoadEmbeddedLUModel(EmbeddedLanguageUnderstandingModel model) + { + lock (_models) + { + _models?.Remove(model.ModelId); + _models?.Add(model); + _recognizerOnce?.ApplyLanguageModels(_models); + _recognizerContinuous?.ApplyLanguageModels(_models); + } + } + public void RegisterIntentCallback(string intentId, string? entityId, string groupId, Action callback) { lock (_callbacks) diff --git a/src/cs/Interfaces/IIntentRecognizerService.cs b/src/cs/Interfaces/IIntentRecognizerService.cs index 22a5c587..d5f923a8 100644 --- a/src/cs/Interfaces/IIntentRecognizerService.cs +++ b/src/cs/Interfaces/IIntentRecognizerService.cs @@ -1,6 +1,5 @@ using macaroni.DataTypes; -using Microsoft.CognitiveServices.Speech.Intent; - +using Microsoft.CognitiveServices.Speech.Intent; namespace macaroni; public interface IIntentRecognizerService @@ -17,6 +16,9 @@ public interface IIntentRecognizerService void LoadPatternMatchingModel(PatternMatchingModel model, Action matchedCallback); void UnloadPatternMatchingModel(PatternMatchingModel model); + void LoadEmbeddedLUModel(EmbeddedLanguageUnderstandingModel model); + void UnloadEmbeddedLUModel(EmbeddedLanguageUnderstandingModel model); + void RegisterIntentCallback(string intentId, string? entityId, string groupId, Action matchedCallback); void RemoveIntentCallbackGroup(string groupId); } diff --git a/src/cs/Tests/test-example-atis.mac b/src/cs/Tests/test-example-atis.mac new file mode 100644 index 00000000..3a2432de --- /dev/null +++ b/src/cs/Tests/test-example-atis.mac @@ -0,0 +1,53 @@ +using System.Reflection; +using System; + +variables: +flight - topping: + -pepperoni + - ham + - bacon + flight - size: + -small + - medium + - large + +commands: + +-triggers: + -'[order] a [{flight-size}] flight [with {flight-topping}]' + - '[order] [a] [{flight-size}] {flight-topping} flight' + + execute: + +-when: + -missing: '{flight-topping}' + - missing: '{flight-size}' + execute: +-speak: 'Flight. What size?' + expect: +-'[a] {flight-size} [with] {flight-topping} [flight]' +- '[a] {flight-size} [flight]' +- '[with] {flight-topping}' + +- when: + -required: '{flight-size}' + - missing: '{flight-topping}' + execute: +-speak: '{flight-size} flight. With what?' + expect: +-'[with] {flight-topping}' + +- when: + -missing: '{flight-size}' + - required: '{flight-topping}' + execute: +-speak: '{flight-topping} flight. What size?' + expect: +-'[a] {flight-size} [flight]' + +- when: + -required: '{flight-size}' + - required: '{flight-topping}' + execute: +-speak: ordering your { flight-size } +flight with { flight-topping } \ No newline at end of file diff --git a/src/cs/Tests/test-example-atis_airfare.mac b/src/cs/Tests/test-example-atis_airfare.mac new file mode 100644 index 00000000..e8aabe1d --- /dev/null +++ b/src/cs/Tests/test-example-atis_airfare.mac @@ -0,0 +1,22 @@ +variables: + +commands: + +- triggers: + - intent: atis_airfare + + execute: + - dialog: + - when: [ missing: '{B-toloc.city_name}' ] + execute: + - speak: Which city are you going to? + expect: + - '[to] {B-toloc.city_name}' + - when: [ missing: '{B-fromloc.city_name}' ] + execute: + - speak: Which city are you leaving from? + expect: + - '[from] {B-fromloc.city_name}' + + - speak: 'OK. It''s $200 from {B-fromloc.city_name} to {B-toloc.city_name}' + - stop: \ No newline at end of file diff --git a/src/cs/Tests/test-example-atis_meal.mac b/src/cs/Tests/test-example-atis_meal.mac new file mode 100644 index 00000000..e1d6ccc2 --- /dev/null +++ b/src/cs/Tests/test-example-atis_meal.mac @@ -0,0 +1,17 @@ +variables: + +commands: + +- triggers: + - intent: atis_meal + + execute: + - dialog: + - when: [ missing: '{B-flight_number}' ] + execute: + - speak: Which flight? + expect: + - '{B-flight_number}' + + - speak: '{B-flight_number} does not serve a meal.' + - stop: \ No newline at end of file diff --git a/src/cs/macaroni_core.csproj b/src/cs/macaroni_core.csproj index 0fcea2c8..b40f0309 100644 --- a/src/cs/macaroni_core.csproj +++ b/src/cs/macaroni_core.csproj @@ -2,7 +2,7 @@ - 1.29 + 1.30.0-alpha.0.37839940 false net6.0;net6.0-windows diff --git a/src/macaroni_api_c/macaroni_api_c.csproj b/src/macaroni_api_c/macaroni_api_c.csproj index 8816aa2a..dd961d34 100644 --- a/src/macaroni_api_c/macaroni_api_c.csproj +++ b/src/macaroni_api_c/macaroni_api_c.csproj @@ -10,10 +10,6 @@ True - - - - diff --git a/src/maui/MauiProgram.cs b/src/maui/MauiProgram.cs index 7100dd01..b3c37bf9 100644 --- a/src/maui/MauiProgram.cs +++ b/src/maui/MauiProgram.cs @@ -121,6 +121,7 @@ public static void MacaroniListenTurnOff() public static bool MacaroniListenToggle() { + var services = _commandSystem?.Services; var service = _commandSystem?.Services?.GetService(); var current = service?.GetState(); var toggled = current switch @@ -225,7 +226,8 @@ private static async Task MacaroniPreCheckFiles() { var appPackagePath = "samples"; var destinationPath = Path.Combine(FileSystem.Current.AppDataDirectory, appPackagePath); - var files = new string[] { "test.mac", "test-example-mr-heating.mac", "test-example-mr-seat-heaters.mac", "ai-translator.mac", "ai-openai.mac" }; + //var files = new string[] { "test.mac", "test-example-mr-heating.mac", "test-example-mr-seat-heaters.mac", "ai-translator.mac", "ai-openai.mac" }; + var files = new string[] { "_.mac", "test-example-atis.mac", "test-example-mr-heating.mac", "test-example-mr-seat-heaters.mac", "translator.mac" }; await CopyPackageFilesAsync(appPackagePath, destinationPath, files, true); appPackagePath = "keywords"; @@ -236,7 +238,7 @@ private static async Task MacaroniPreCheckFiles() appPackagePath = "embedded"; destinationPath = Path.Combine(FileSystem.Current.AppDataDirectory, appPackagePath); - var dirs = new string[] { "sr", "tts" }; + var dirs = new string[] { "sr", "tts", "lu" }; foreach (var dir in dirs) { var fileName = $"{appPackagePath}/{dir}.files"; diff --git a/src/maui/maui.csproj b/src/maui/maui.csproj index c51c41c2..cd169208 100644 --- a/src/maui/maui.csproj +++ b/src/maui/maui.csproj @@ -2,10 +2,10 @@ - 1.29 + 1.30.0-alpha.0.37839940 false - net6.0-android33.0 + net7.0-android33.0 Exe maui true @@ -97,4 +97,8 @@ + + + + diff --git a/src/mr/mr.csproj b/src/mr/mr.csproj index ca319229..3d479c41 100644 --- a/src/mr/mr.csproj +++ b/src/mr/mr.csproj @@ -2,7 +2,7 @@ - 1.29 + 1.30.0-alpha.0.37839940 false Exe From 3217bcdbece9bbf79b888f86771aef8eb19fb7f4 Mon Sep 17 00:00:00 2001 From: Nate Ko Date: Mon, 14 Aug 2023 13:22:43 -0700 Subject: [PATCH 2/7] Working integration with SDK 1.25.0-alpha.0.31956135 --- src/app/macaroni_app.csproj | 4 +-- src/cs/CommandSystem/DeveloperSettings.cs | 19 +++++++------ .../SpeechConfigService.cs | 2 ++ .../IntentRecognizerService.cs | 27 +++++++++++++++---- src/cs/macaroni_core.csproj | 6 ++--- src/maui/MauiProgram.cs | 11 +++----- src/maui/maui.csproj | 7 ++--- src/mr/mr.csproj | 5 ++-- 8 files changed, 50 insertions(+), 31 deletions(-) diff --git a/src/app/macaroni_app.csproj b/src/app/macaroni_app.csproj index 831c26fe..f7e7c0d6 100644 --- a/src/app/macaroni_app.csproj +++ b/src/app/macaroni_app.csproj @@ -1,10 +1,8 @@  - - 1.30.0-alpha.0.37839940 + 1.25.0-alpha.0.31956135 false - WinExe net6.0-windows macaroni diff --git a/src/cs/CommandSystem/DeveloperSettings.cs b/src/cs/CommandSystem/DeveloperSettings.cs index 74b2abe0..3ecba278 100644 --- a/src/cs/CommandSystem/DeveloperSettings.cs +++ b/src/cs/CommandSystem/DeveloperSettings.cs @@ -1,6 +1,4 @@ -using Microsoft.Extensions.DependencyInjection; - -namespace macaroni; +namespace macaroni; internal class DeveloperSettings : Dictionary, IDeveloperSettings { @@ -43,6 +41,7 @@ private void Init() this.Add("CLU_DEPLOYMENT_NAME", "v1"); this.Add("CLU_ENDPOINT", "https://internal-gm-dev.cognitiveservices.azure.com"); this.Add("CLU_PROJECT_NAME", "GM-Orchestrator"); + this.Add("OPEN_AI_DEPLOYMENT", "robch-southcentral-oai-txtdav002"); this.Add("OPEN_AI_ENDPOINT", "https://robch-openai.openai.azure.com/"); this.Add("SPEECH_REGION", "westus"); @@ -59,22 +58,26 @@ private void Init() // DEVELOPER: To use Embedded speech (SR and TTS), update your local source to set `embedded=true` and replace // `UPDATE_PATH_HERE` placeholders with appropriate locations where the model data files can be found - var embedded = false; // !!!IMPORTANT!!!: DO NOT CHECK IN this file with embedded set to TRUE + var embedded = true; // !!!IMPORTANT!!!: DO NOT CHECK IN this file with embedded set to TRUE if (embedded) // also update true/false in `csproj` files { if (OS.IsWindows()) { this.Add("EMBEDDED_SPEECH_RECOGNITION_MODEL_PATH", @"UPDATE_PATH_HERE"); // e.g. @"D:\src\macaroni\external\embedded_sr_model_FP_en-US_V8_onnx"); this.Add("EMBEDDED_SPEECH_SYNTHESIS_VOICE_PATH", @"UPDATE_PATH_HERE"); // e.g. @"D:\src\macaroni\external\embedded_tts_mark_sps"); + this.Add("EMBEDDED_LANGUAGE_UNDERSTANDING_MODEL_PATH", @"UPDATE_PATH_HERE"); // e.g. @"D:\src\macaroni\external\lu"); } else { - this.Add("EMBEDDED_SPEECH_RECOGNITION_MODEL_PATH", @"UPDATE_PATH_HERE"); // e.g. @"/data/user/0/com.companyname.maui/files/embedded/sr"); - this.Add("EMBEDDED_SPEECH_SYNTHESIS_VOICE_PATH", @"UPDATE_PATH_HERE"); // e.g. @"/data/user/0/com.companyname.maui/files/embedded/tts"); + this.Add("EMBEDDED_SPEECH_RECOGNITION_MODEL_PATH", @"/storage/emulated/0/Android/data/com.companyname.maui/files/SR7"); // e.g. @"/data/user/0/com.companyname.maui/files/embedded/sr"); + //this.Add("EMBEDDED_SPEECH_RECOGNITION_MODEL_PATH", @"/storage/emulated/0/Android/data/com.companyname.maui/files/SR81encrypt"); // e.g. @"/data/user/0/com.companyname.maui/files/embedded/sr"); + this.Add("EMBEDDED_SPEECH_SYNTHESIS_VOICE_PATH", @"/storage/emulated/0/Android/data/com.companyname.maui/files/TTS"); // e.g. @" / data/user/0/com.companyname.maui/files/embedded/tts"); + this.Add("EMBEDDED_LANGUAGE_UNDERSTANDING_MODEL_PATH", @"/storage/emulated/0/Android/data/com.companyname.maui/files/LU"); // e.g. @" / data/user/0/com.companyname.maui/files/embedded/lu"); } - this.Add("EMBEDDED_SPEECH_RECOGNITION_MODEL_NAME", "Microsoft Speech Recognizer en-US FP Model V8"); - this.Add("EMBEDDED_SPEECH_SYNTHESIS_VOICE_NAME", "Microsoft Server Speech Text to Speech Voice (en-US, Mark, Apollo)"); + this.Add("EMBEDDED_SPEECH_RECOGNITION_MODEL_NAME", "Microsoft Speech Recognizer en-US FP Model V7"); + //this.Add("EMBEDDED_SPEECH_RECOGNITION_MODEL_NAME", "Microsoft Speech Recognizer en-US FP Model V8.1"); + this.Add("EMBEDDED_SPEECH_SYNTHESIS_VOICE_NAME", "Microsoft Server Speech Text to Speech Voice (en-US, AriaNeural)"); this.Add("EMBEDDED_SPEECH_RECOGNITION_MODEL_KEY", ""); this.Add("EMBEDDED_SPEECH_SYNTHESIS_VOICE_KEY", ""); } diff --git a/src/cs/CommandSystemServices/SpeechConfigService.cs b/src/cs/CommandSystemServices/SpeechConfigService.cs index 0248963e..0a844bcb 100644 --- a/src/cs/CommandSystemServices/SpeechConfigService.cs +++ b/src/cs/CommandSystemServices/SpeechConfigService.cs @@ -69,6 +69,8 @@ public SpeechConfig GetSpeechConfig(SpeechConfigKind kind) config.SetSpeechSynthesisVoice(voiceName, voiceKey); config.SetProperty(PropertyId.Speech_SegmentationSilenceTimeoutMs, GetSegmentationTimeout()); config.SetProperty("EmbeddedSpeech-DisableTelemetry", "true"); + var file = Path.Combine(@"/storage/emulated/0/Android/data/com.companyname.maui/files", $"macaroni.carbon-{DateTime.Now.ToFileTime()}.log"); + config.SetProperty(PropertyId.Speech_LogFilename, file); if (voiceName.Contains("Neural")) { diff --git a/src/cs/IntentRecognition/IntentRecognizerService.cs b/src/cs/IntentRecognition/IntentRecognizerService.cs index 290ac171..c6cd7bbd 100644 --- a/src/cs/IntentRecognition/IntentRecognizerService.cs +++ b/src/cs/IntentRecognition/IntentRecognizerService.cs @@ -44,6 +44,7 @@ public IntentRecognizerService(IServiceProvider services, IBroadcastMessageServi { _useCLU = false; } + _useCLU = false; value = namedStateService.GetNamedState("__macaroni.keyword"); if (!string.IsNullOrEmpty(value)) @@ -316,6 +317,10 @@ private void CheckInitCLU() { InitCLU(); } + else + { + InitEmbeddedLU(); + } } private void InitCLU() @@ -328,15 +333,27 @@ private void InitCLU() var project = settings.Get("CLU_PROJECT_NAME")?.Trim(); var deployment = settings.Get("CLU_DEPLOYMENT_NAME")?.Trim(); + // TODO, nateko, enable this after upgrading the SDK. // only create the model if we have everything - if ((key ?? endpoint ?? project ?? deployment) != null) - { - var cluMode = new ConversationalLanguageUnderstandingModel(key, endpoint, project, deployment); - _models.Add(new ConversationalLanguageUnderstandingModel(key, endpoint, project, deployment)); - } + //if ((key ?? endpoint ?? project ?? deployment) != null) + //{ + // var cluMode = new ConversationalLanguageUnderstandingModel(key, endpoint, project, deployment); + // _models.Add(new ConversationalLanguageUnderstandingModel(key, endpoint, project, deployment)); + //} // end TODO } + private void InitEmbeddedLU() + { + //TODO: this should come from some extension that handles declarations of CLU models. Also should we + // support multiple CLU projects? + var settings = _serviceProvider.GetRequiredService(); + var luModelPath = settings.Get("EMBEDDED_LANGUAGE_UNDERSTANDING_MODEL_PATH") ?? string.Empty; + var iniFile = Path.Combine(luModelPath.Trim(), $"lu.ini"); + + _models.Add(EmbeddedLanguageUnderstandingModel.FromIniFile(iniFile, string.Empty)); + } + private void ResetRecognizer(ref IntentRecognizer? recognizer) { lock (this) diff --git a/src/cs/macaroni_core.csproj b/src/cs/macaroni_core.csproj index b40f0309..9673b243 100644 --- a/src/cs/macaroni_core.csproj +++ b/src/cs/macaroni_core.csproj @@ -1,9 +1,9 @@  - - 1.30.0-alpha.0.37839940 - false + + 1.25.0-alpha.0.31956135 + true net6.0;net6.0-windows false diff --git a/src/maui/MauiProgram.cs b/src/maui/MauiProgram.cs index b3c37bf9..851a628b 100644 --- a/src/maui/MauiProgram.cs +++ b/src/maui/MauiProgram.cs @@ -1,9 +1,5 @@ -using System.Diagnostics; -using System.Threading.Tasks; -using Android.Content; -using Android.Content.PM; -using Microsoft.Extensions.Hosting; -using Newtonsoft.Json.Linq; +using Microsoft.Extensions.Hosting; +using System.Diagnostics; namespace maui { @@ -40,7 +36,8 @@ public static async Task CreateMacaroni() .AddExceptionHandler(macaroni.ExceptionKind.System, DisplaySystemException) ) .ConfigureResolvers(resolvers => resolvers - .UseContext("folders.macros", FileSystem.Current.AppDataDirectory) + //.UseContext("folders.macros", FileSystem.Current.AppDataDirectory) + .UseContext("folders.macros", @"/storage/emulated/0/Android/data/com.companyname.maui/files/mac") ) .ConfigureSources(sources => sources .UseDefaultFolderMonitor(true) diff --git a/src/maui/maui.csproj b/src/maui/maui.csproj index cd169208..f5d36e4e 100644 --- a/src/maui/maui.csproj +++ b/src/maui/maui.csproj @@ -2,10 +2,11 @@ - 1.30.0-alpha.0.37839940 - false + + 1.25.0-alpha.0.31956135 + true - net7.0-android33.0 + net6.0-android Exe maui true diff --git a/src/mr/mr.csproj b/src/mr/mr.csproj index 3d479c41..78d5dd3e 100644 --- a/src/mr/mr.csproj +++ b/src/mr/mr.csproj @@ -2,8 +2,9 @@ - 1.30.0-alpha.0.37839940 - false + + 1.25.0-alpha.0.31956135 + true Exe net6.0 From 10c1dcfd060743727dbae34985839c4322bc85d6 Mon Sep 17 00:00:00 2001 From: Nate Ko Date: Tue, 15 Aug 2023 06:47:40 -0700 Subject: [PATCH 3/7] Upgrade SDK --- src/app/macaroni_app.csproj | 2 +- src/cs/CommandSystem/DeveloperSettings.cs | 10 ++++------ src/cs/CommandSystemServices/SpeechConfigService.cs | 1 - src/cs/IntentRecognition/IntentRecognizerService.cs | 1 - src/cs/macaroni_core.csproj | 3 +-- src/maui/MauiProgram.cs | 2 +- src/maui/maui.csproj | 5 ++--- src/mr/mr.csproj | 4 +--- 8 files changed, 10 insertions(+), 18 deletions(-) diff --git a/src/app/macaroni_app.csproj b/src/app/macaroni_app.csproj index f7e7c0d6..db789a17 100644 --- a/src/app/macaroni_app.csproj +++ b/src/app/macaroni_app.csproj @@ -1,7 +1,7 @@  - 1.25.0-alpha.0.31956135 + 1.30.0-alpha.0.38264386 false WinExe net6.0-windows diff --git a/src/cs/CommandSystem/DeveloperSettings.cs b/src/cs/CommandSystem/DeveloperSettings.cs index 3ecba278..1c596927 100644 --- a/src/cs/CommandSystem/DeveloperSettings.cs +++ b/src/cs/CommandSystem/DeveloperSettings.cs @@ -69,16 +69,14 @@ private void Init() } else { - this.Add("EMBEDDED_SPEECH_RECOGNITION_MODEL_PATH", @"/storage/emulated/0/Android/data/com.companyname.maui/files/SR7"); // e.g. @"/data/user/0/com.companyname.maui/files/embedded/sr"); - //this.Add("EMBEDDED_SPEECH_RECOGNITION_MODEL_PATH", @"/storage/emulated/0/Android/data/com.companyname.maui/files/SR81encrypt"); // e.g. @"/data/user/0/com.companyname.maui/files/embedded/sr"); + this.Add("EMBEDDED_SPEECH_RECOGNITION_MODEL_PATH", @"/storage/emulated/0/Android/data/com.companyname.maui/files/SRx"); // e.g. @"/data/user/0/com.companyname.maui/files/embedded/sr"); this.Add("EMBEDDED_SPEECH_SYNTHESIS_VOICE_PATH", @"/storage/emulated/0/Android/data/com.companyname.maui/files/TTS"); // e.g. @" / data/user/0/com.companyname.maui/files/embedded/tts"); - this.Add("EMBEDDED_LANGUAGE_UNDERSTANDING_MODEL_PATH", @"/storage/emulated/0/Android/data/com.companyname.maui/files/LU"); // e.g. @" / data/user/0/com.companyname.maui/files/embedded/lu"); + this.Add("EMBEDDED_LANGUAGE_UNDERSTANDING_MODEL_PATH", @"/storage/emulated/0/Android/data/com.companyname.maui/files/LUgm"); // e.g. @" / data/user/0/com.companyname.maui/files/embedded/lu"); } - this.Add("EMBEDDED_SPEECH_RECOGNITION_MODEL_NAME", "Microsoft Speech Recognizer en-US FP Model V7"); - //this.Add("EMBEDDED_SPEECH_RECOGNITION_MODEL_NAME", "Microsoft Speech Recognizer en-US FP Model V8.1"); + this.Add("EMBEDDED_SPEECH_RECOGNITION_MODEL_NAME", "Microsoft Speech Recognizer en-US FP Model V8.1"); this.Add("EMBEDDED_SPEECH_SYNTHESIS_VOICE_NAME", "Microsoft Server Speech Text to Speech Voice (en-US, AriaNeural)"); - this.Add("EMBEDDED_SPEECH_RECOGNITION_MODEL_KEY", ""); + this.Add("EMBEDDED_SPEECH_RECOGNITION_MODEL_KEY", ""); this.Add("EMBEDDED_SPEECH_SYNTHESIS_VOICE_KEY", ""); } } diff --git a/src/cs/CommandSystemServices/SpeechConfigService.cs b/src/cs/CommandSystemServices/SpeechConfigService.cs index 0a844bcb..210b27d0 100644 --- a/src/cs/CommandSystemServices/SpeechConfigService.cs +++ b/src/cs/CommandSystemServices/SpeechConfigService.cs @@ -68,7 +68,6 @@ public SpeechConfig GetSpeechConfig(SpeechConfigKind kind) config.SetSpeechRecognitionModel(modelName, modelKey); config.SetSpeechSynthesisVoice(voiceName, voiceKey); config.SetProperty(PropertyId.Speech_SegmentationSilenceTimeoutMs, GetSegmentationTimeout()); - config.SetProperty("EmbeddedSpeech-DisableTelemetry", "true"); var file = Path.Combine(@"/storage/emulated/0/Android/data/com.companyname.maui/files", $"macaroni.carbon-{DateTime.Now.ToFileTime()}.log"); config.SetProperty(PropertyId.Speech_LogFilename, file); diff --git a/src/cs/IntentRecognition/IntentRecognizerService.cs b/src/cs/IntentRecognition/IntentRecognizerService.cs index c6cd7bbd..65c3cd50 100644 --- a/src/cs/IntentRecognition/IntentRecognizerService.cs +++ b/src/cs/IntentRecognition/IntentRecognizerService.cs @@ -44,7 +44,6 @@ public IntentRecognizerService(IServiceProvider services, IBroadcastMessageServi { _useCLU = false; } - _useCLU = false; value = namedStateService.GetNamedState("__macaroni.keyword"); if (!string.IsNullOrEmpty(value)) diff --git a/src/cs/macaroni_core.csproj b/src/cs/macaroni_core.csproj index 9673b243..2a0ac802 100644 --- a/src/cs/macaroni_core.csproj +++ b/src/cs/macaroni_core.csproj @@ -1,8 +1,7 @@  - - 1.25.0-alpha.0.31956135 + 1.30.0-alpha.0.38264386 true net6.0;net6.0-windows diff --git a/src/maui/MauiProgram.cs b/src/maui/MauiProgram.cs index 851a628b..1921a798 100644 --- a/src/maui/MauiProgram.cs +++ b/src/maui/MauiProgram.cs @@ -69,7 +69,7 @@ public static async Task CreateMacaroni() .AddListeningStateChangedHandler(state => DisplayRecognizerStateChange(state)) .UseDefaultListeningState(macaroni.ListeningState.Sleep) .UseKeywordRecognition(GetKeyword(), GetKeywordModelFile()) - .UseHighRecall(true, false) + .UseHighRecall(false, false) ) .ConfigureUi(ui => ui .UseDisplay(DisplayText) diff --git a/src/maui/maui.csproj b/src/maui/maui.csproj index f5d36e4e..02bf5fbc 100644 --- a/src/maui/maui.csproj +++ b/src/maui/maui.csproj @@ -2,11 +2,10 @@ - - 1.25.0-alpha.0.31956135 + 1.30.0-alpha.0.38264386 true - net6.0-android + net7.0-android33.0 Exe maui true diff --git a/src/mr/mr.csproj b/src/mr/mr.csproj index 78d5dd3e..dab5fb56 100644 --- a/src/mr/mr.csproj +++ b/src/mr/mr.csproj @@ -1,9 +1,7 @@ - - - 1.25.0-alpha.0.31956135 + 1.30.0-alpha.0.38264386 true Exe From e62a2c916d3d5dc8f6619cb496e4662753d4572f Mon Sep 17 00:00:00 2001 From: Nate Ko Date: Tue, 15 Aug 2023 07:54:13 -0700 Subject: [PATCH 4/7] Parameterize SDK logging --- src/cs/CommandSystem/DeveloperSettings.cs | 11 ++++++++++- src/cs/CommandSystemServices/SpeechConfigService.cs | 12 ++++++++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/cs/CommandSystem/DeveloperSettings.cs b/src/cs/CommandSystem/DeveloperSettings.cs index 1c596927..035dc98b 100644 --- a/src/cs/CommandSystem/DeveloperSettings.cs +++ b/src/cs/CommandSystem/DeveloperSettings.cs @@ -55,6 +55,15 @@ private void Init() this.Add("VISION_ENDPOINT", "https://carbon-vision.cognitiveservices.azure.com"); } + if (OS.IsWindows()) + { + this.Add("SPEECH_SDK_LOG_PATH", $"macaroni.carbon-{DateTime.Now.ToFileTime()}.log"); + } + else + { + this.Add("SPEECH_SDK_LOG_PATH", Path.Combine(@"/storage/emulated/0/Android/data/com.companyname.maui/files", $"macaroni.carbon-{DateTime.Now.ToFileTime()}.log")); // e.g. @" / data/user/0/com.companyname.maui/files/embedded/lu"); + } + // DEVELOPER: To use Embedded speech (SR and TTS), update your local source to set `embedded=true` and replace // `UPDATE_PATH_HERE` placeholders with appropriate locations where the model data files can be found @@ -76,7 +85,7 @@ private void Init() this.Add("EMBEDDED_SPEECH_RECOGNITION_MODEL_NAME", "Microsoft Speech Recognizer en-US FP Model V8.1"); this.Add("EMBEDDED_SPEECH_SYNTHESIS_VOICE_NAME", "Microsoft Server Speech Text to Speech Voice (en-US, AriaNeural)"); - this.Add("EMBEDDED_SPEECH_RECOGNITION_MODEL_KEY", ""); + this.Add("EMBEDDED_SPEECH_RECOGNITION_MODEL_KEY", ""); this.Add("EMBEDDED_SPEECH_SYNTHESIS_VOICE_KEY", ""); } } diff --git a/src/cs/CommandSystemServices/SpeechConfigService.cs b/src/cs/CommandSystemServices/SpeechConfigService.cs index 210b27d0..63f5a384 100644 --- a/src/cs/CommandSystemServices/SpeechConfigService.cs +++ b/src/cs/CommandSystemServices/SpeechConfigService.cs @@ -61,16 +61,20 @@ public SpeechConfig GetSpeechConfig(SpeechConfigKind kind) var modelKey = _settings.Get("EMBEDDED_SPEECH_RECOGNITION_MODEL_KEY", ""); var voiceName = _settings.Get("EMBEDDED_SPEECH_SYNTHESIS_VOICE_NAME", ""); var voiceKey = _settings.Get("EMBEDDED_SPEECH_SYNTHESIS_VOICE_KEY", ""); + var sdkLogFile = _settings.Get("SPEECH_SDK_LOG_PATH", ""); + + var config = EmbeddedSpeechConfig.FromPaths(embeddedPaths); + + if (!string.IsNullOrEmpty(sdkLogFile)) + { + config.SetProperty(PropertyId.Speech_LogFilename, sdkLogFile); + } if (!string.IsNullOrEmpty(modelName) && !string.IsNullOrEmpty(voiceName)) { - var config = EmbeddedSpeechConfig.FromPaths(embeddedPaths); config.SetSpeechRecognitionModel(modelName, modelKey); config.SetSpeechSynthesisVoice(voiceName, voiceKey); config.SetProperty(PropertyId.Speech_SegmentationSilenceTimeoutMs, GetSegmentationTimeout()); - var file = Path.Combine(@"/storage/emulated/0/Android/data/com.companyname.maui/files", $"macaroni.carbon-{DateTime.Now.ToFileTime()}.log"); - config.SetProperty(PropertyId.Speech_LogFilename, file); - if (voiceName.Contains("Neural")) { config.SetSpeechSynthesisOutputFormat(SpeechSynthesisOutputFormat.Riff24Khz16BitMonoPcm); From 506eea90cdf7a632565f6c9791ff4c653dbf841b Mon Sep 17 00:00:00 2001 From: Nate Ko Date: Tue, 15 Aug 2023 14:36:48 -0700 Subject: [PATCH 5/7] Add LU model files. --- src/cs/CommandSystem/DeveloperSettings.cs | 6 +++--- src/cs/IntentRecognition/IntentRecognizerService.cs | 4 ++-- src/maui/maui.csproj | 4 ++++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/cs/CommandSystem/DeveloperSettings.cs b/src/cs/CommandSystem/DeveloperSettings.cs index 035dc98b..bbc2455e 100644 --- a/src/cs/CommandSystem/DeveloperSettings.cs +++ b/src/cs/CommandSystem/DeveloperSettings.cs @@ -78,9 +78,9 @@ private void Init() } else { - this.Add("EMBEDDED_SPEECH_RECOGNITION_MODEL_PATH", @"/storage/emulated/0/Android/data/com.companyname.maui/files/SRx"); // e.g. @"/data/user/0/com.companyname.maui/files/embedded/sr"); - this.Add("EMBEDDED_SPEECH_SYNTHESIS_VOICE_PATH", @"/storage/emulated/0/Android/data/com.companyname.maui/files/TTS"); // e.g. @" / data/user/0/com.companyname.maui/files/embedded/tts"); - this.Add("EMBEDDED_LANGUAGE_UNDERSTANDING_MODEL_PATH", @"/storage/emulated/0/Android/data/com.companyname.maui/files/LUgm"); // e.g. @" / data/user/0/com.companyname.maui/files/embedded/lu"); + this.Add("EMBEDDED_SPEECH_RECOGNITION_MODEL_PATH", @"/data/user/0/com.companyname.maui/files/embedded/sr"); // e.g. @"/data/user/0/com.companyname.maui/files/embedded/sr"); + this.Add("EMBEDDED_SPEECH_SYNTHESIS_VOICE_PATH", @"/data/user/0/com.companyname.maui/files/embedded/tts"); // e.g. @" / data/user/0/com.companyname.maui/files/embedded/tts"); + this.Add("EMBEDDED_LANGUAGE_UNDERSTANDING_MODEL_PATH", @"/data/user/0/com.companyname.maui/files/embedded/lu"); // e.g. @" / data/user/0/com.companyname.maui/files/embedded/lu"); } this.Add("EMBEDDED_SPEECH_RECOGNITION_MODEL_NAME", "Microsoft Speech Recognizer en-US FP Model V8.1"); diff --git a/src/cs/IntentRecognition/IntentRecognizerService.cs b/src/cs/IntentRecognition/IntentRecognizerService.cs index 65c3cd50..b068bfde 100644 --- a/src/cs/IntentRecognition/IntentRecognizerService.cs +++ b/src/cs/IntentRecognition/IntentRecognizerService.cs @@ -415,9 +415,9 @@ private IntentRecognizer CreateIntentRecognizer() { return new IntentRecognizer(embeddedConfig, audio); } - catch (Exception) + catch (Exception e) { - MR.DBG_TRACE_ERROR("Failed to create embedded IntentRecognizer"); + MR.DBG_TRACE_ERROR($"Failed to create embedded IntentRecognizer {e.Message}"); } } diff --git a/src/maui/maui.csproj b/src/maui/maui.csproj index 02bf5fbc..a0a2c71b 100644 --- a/src/maui/maui.csproj +++ b/src/maui/maui.csproj @@ -60,6 +60,10 @@ embedded\tts\%(RecursiveDir)/%(FileName)%(Extension) PreserveNewest + + embedded\lu\%(RecursiveDir)/%(FileName)%(Extension) + PreserveNewest + embedded\%(RecursiveDir)/%(FileName)%(Extension) PreserveNewest From 70c5fcdc0aa40ab4e64773f271824001636e875c Mon Sep 17 00:00:00 2001 From: Nate Ko Date: Tue, 15 Aug 2023 15:50:08 -0700 Subject: [PATCH 6/7] Remove use of external data dir for .mac files --- src/cs/CommandSystem/DeveloperSettings.cs | 2 +- src/cs/Samples/windows.mac | 19 +++++++++++++++++++ src/maui/MauiProgram.cs | 8 +++----- 3 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 src/cs/Samples/windows.mac diff --git a/src/cs/CommandSystem/DeveloperSettings.cs b/src/cs/CommandSystem/DeveloperSettings.cs index bbc2455e..d55ee19f 100644 --- a/src/cs/CommandSystem/DeveloperSettings.cs +++ b/src/cs/CommandSystem/DeveloperSettings.cs @@ -85,7 +85,7 @@ private void Init() this.Add("EMBEDDED_SPEECH_RECOGNITION_MODEL_NAME", "Microsoft Speech Recognizer en-US FP Model V8.1"); this.Add("EMBEDDED_SPEECH_SYNTHESIS_VOICE_NAME", "Microsoft Server Speech Text to Speech Voice (en-US, AriaNeural)"); - this.Add("EMBEDDED_SPEECH_RECOGNITION_MODEL_KEY", ""); + this.Add("EMBEDDED_SPEECH_RECOGNITION_MODEL_KEY", "XUw7C0rcZAIQvG837YP4F1KHz2RqYuQgtyXrcbFhsWFNGjG08HJElmPGesxNMbib0s8y39NEti3q3RwPNRbuDv75ejZbTa9yLcTAUixC"); this.Add("EMBEDDED_SPEECH_SYNTHESIS_VOICE_KEY", ""); } } diff --git a/src/cs/Samples/windows.mac b/src/cs/Samples/windows.mac new file mode 100644 index 00000000..52f2bb16 --- /dev/null +++ b/src/cs/Samples/windows.mac @@ -0,0 +1,19 @@ +variables: + +commands: + +- triggers: + - intent: Window + execute: + - speak: trying + - switch: + - case: [ condition: '{Toggle}==Open'] + execute: + - speak: Opening Windows + - case: [ condition: '{Toggle}==Close'] + execute: + - speak: Closing Windows + - case: [] + execute: + - speak: what the heck? + - speak: done diff --git a/src/maui/MauiProgram.cs b/src/maui/MauiProgram.cs index 1921a798..5e0fbd19 100644 --- a/src/maui/MauiProgram.cs +++ b/src/maui/MauiProgram.cs @@ -36,8 +36,7 @@ public static async Task CreateMacaroni() .AddExceptionHandler(macaroni.ExceptionKind.System, DisplaySystemException) ) .ConfigureResolvers(resolvers => resolvers - //.UseContext("folders.macros", FileSystem.Current.AppDataDirectory) - .UseContext("folders.macros", @"/storage/emulated/0/Android/data/com.companyname.maui/files/mac") + .UseContext("folders.macros", FileSystem.Current.AppDataDirectory) ) .ConfigureSources(sources => sources .UseDefaultFolderMonitor(true) @@ -68,7 +67,7 @@ public static async Task CreateMacaroni() .ConfigureSpeech(speech => speech .AddListeningStateChangedHandler(state => DisplayRecognizerStateChange(state)) .UseDefaultListeningState(macaroni.ListeningState.Sleep) - .UseKeywordRecognition(GetKeyword(), GetKeywordModelFile()) + .UseKeywordRecognition(string.Empty, GetKeywordModelFile()) //TODO, nateko doesnt have this model, disable keyword. .UseHighRecall(false, false) ) .ConfigureUi(ui => ui @@ -223,8 +222,7 @@ private static async Task MacaroniPreCheckFiles() { var appPackagePath = "samples"; var destinationPath = Path.Combine(FileSystem.Current.AppDataDirectory, appPackagePath); - //var files = new string[] { "test.mac", "test-example-mr-heating.mac", "test-example-mr-seat-heaters.mac", "ai-translator.mac", "ai-openai.mac" }; - var files = new string[] { "_.mac", "test-example-atis.mac", "test-example-mr-heating.mac", "test-example-mr-seat-heaters.mac", "translator.mac" }; + var files = new string[] { "test.mac", "test-example-mr-heating.mac", "test-example-mr-seat-heaters.mac", "ai-translator.mac", "ai-openai.mac", "windows.mac" }; await CopyPackageFilesAsync(appPackagePath, destinationPath, files, true); appPackagePath = "keywords"; From 9db930e96366aa4039e397b9b0f70efe91d08464 Mon Sep 17 00:00:00 2001 From: Nate Ko Date: Wed, 16 Aug 2023 09:57:31 -0700 Subject: [PATCH 7/7] Remove accidental commit --- src/cs/CommandSystem/DeveloperSettings.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cs/CommandSystem/DeveloperSettings.cs b/src/cs/CommandSystem/DeveloperSettings.cs index d55ee19f..bbc2455e 100644 --- a/src/cs/CommandSystem/DeveloperSettings.cs +++ b/src/cs/CommandSystem/DeveloperSettings.cs @@ -85,7 +85,7 @@ private void Init() this.Add("EMBEDDED_SPEECH_RECOGNITION_MODEL_NAME", "Microsoft Speech Recognizer en-US FP Model V8.1"); this.Add("EMBEDDED_SPEECH_SYNTHESIS_VOICE_NAME", "Microsoft Server Speech Text to Speech Voice (en-US, AriaNeural)"); - this.Add("EMBEDDED_SPEECH_RECOGNITION_MODEL_KEY", "XUw7C0rcZAIQvG837YP4F1KHz2RqYuQgtyXrcbFhsWFNGjG08HJElmPGesxNMbib0s8y39NEti3q3RwPNRbuDv75ejZbTa9yLcTAUixC"); + this.Add("EMBEDDED_SPEECH_RECOGNITION_MODEL_KEY", ""); this.Add("EMBEDDED_SPEECH_SYNTHESIS_VOICE_KEY", ""); } }