From 9aabb23c8bcc1d34b6183a994207cfddadb04445 Mon Sep 17 00:00:00 2001 From: Rob G Date: Mon, 14 Oct 2024 12:22:50 +0100 Subject: [PATCH] Expose speech recognition options in the inspector, and pass it into playthourgh initialization --- Scripts/Audio/SpeechRecognitionOptions.cs | 1 - Scripts/PlaythroughInstanceBase.cs | 13 +++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Scripts/Audio/SpeechRecognitionOptions.cs b/Scripts/Audio/SpeechRecognitionOptions.cs index 7c92669..b9e1458 100644 --- a/Scripts/Audio/SpeechRecognitionOptions.cs +++ b/Scripts/Audio/SpeechRecognitionOptions.cs @@ -16,7 +16,6 @@ public enum SpeechRecognitionService public string Service { - get { switch (_service) diff --git a/Scripts/PlaythroughInstanceBase.cs b/Scripts/PlaythroughInstanceBase.cs index 5120709..9d50e48 100644 --- a/Scripts/PlaythroughInstanceBase.cs +++ b/Scripts/PlaythroughInstanceBase.cs @@ -27,9 +27,13 @@ public abstract class PlaythroughInstanceBase : MonoBehaviour [Header("Settings")] [SerializeField] - [Tooltip("Configuration node of the Speech output.")] + [Tooltip("Configuration of the Speech output.")] protected SpeechOptions _speechOptions; + [SerializeField] + [Tooltip("Configuration of the speech-to-text")] + protected SpeechRecognitionOptions _speechRecognitionOptions; + [SerializeField] [Tooltip("Activate internal Charisma-specific logging.")] protected bool _enableLogging; @@ -56,9 +60,10 @@ public void LoadPlaythrough() // We can now create a new charisma object and pass it our token. _playthrough = new Playthrough( - token: tokenResponse.Token, - playthroughUuid: tokenResponse.PlaythroughUuid, - _speechOptions + tokenResponse.Token, + tokenResponse.PlaythroughUuid, + _speechOptions, + _speechRecognitionOptions ); OnPlaythroughLoaded(tokenResponse, conversationUuid);