Fix transcription bug.

This commit is contained in:
Nadine Ganz 2026-05-05 14:03:41 +02:00
parent aa108a3df4
commit 5e097278ce
5 changed files with 21 additions and 6 deletions

View File

@ -180,9 +180,6 @@ Tree("05_Tutorial") {
BTC.SetVoiceName("it-IT-FabiolaNeural") BTC.SetVoiceName("it-IT-FabiolaNeural")
BTC.SynthesizeText("Cosa ti piace di più? Spaghetti, pizza o risotto?") BTC.SynthesizeText("Cosa ti piace di più? Spaghetti, pizza o risotto?")
BTC.SpeechOutputEnded() BTC.SpeechOutputEnded()
BTC.SetSpeechRecognitionLanguage("de-DE")
BTC.SetVoiceName("de-DE-SeraphinaMultilingualNeural")
BTC.Show("GO.HINTS.SpeakHint") BTC.Show("GO.HINTS.SpeakHint")
BTC.AddPossbileSpeechIntent("Zugabteil-Tutorial-U-15") BTC.AddPossbileSpeechIntent("Zugabteil-Tutorial-U-15")
@ -199,6 +196,8 @@ Tree("05_Tutorial") {
// -- Selector 1: Intent erkannt // -- Selector 1: Intent erkannt
Composite(Sequence) { Composite(Sequence) {
BTC.SpeechIntentRecognized() BTC.SpeechIntentRecognized()
BTC.SetSpeechRecognitionLanguage("de-DE")
BTC.SetVoiceName("de-DE-SeraphinaMultilingualNeural")
// Intent erkannt // Intent erkannt
Composite(Race) { Composite(Race) {
@ -239,6 +238,9 @@ Tree("05_Tutorial") {
BTC.Show("GO.HANDMENU.Option3Button") BTC.Show("GO.HANDMENU.Option3Button")
} }
BTC.SetSpeechRecognitionLanguage("de-DE")
BTC.SetVoiceName("de-DE-SeraphinaMultilingualNeural")
Composite(Race) { Composite(Race) {
Composite(Sequence) { Composite(Sequence) {
// Spaghetti // Spaghetti
@ -290,6 +292,8 @@ Tree("05_Tutorial") {
BTC.AbortSpeechEventListener() BTC.AbortSpeechEventListener()
BTC.StopSpeechIntentRecognition() BTC.StopSpeechIntentRecognition()
BTC.ClearPossbileSpeechIntents() BTC.ClearPossbileSpeechIntents()
BTC.SetSpeechRecognitionLanguage("de-DE")
BTC.SetVoiceName("de-DE-SeraphinaMultilingualNeural")
Composite(Sequence) { Composite(Sequence) {
Composite(Marathon) { Composite(Marathon) {

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 8f4c1440ae5ec414dbc7d3a5c54dda6b
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1 +1 @@
2025-08-04T16:03:18.8396148Z 2026-05-05T11:47:25.7382830Z

View File

@ -144,7 +144,10 @@ public class SpeechRecognitionService : MonoBehaviour
void OnEnable() void OnEnable()
{ {
this.initialize(this.initialRecognitionLanguageCode); if (this.speechConfig == null)
{
this.initialize(this.initialRecognitionLanguageCode);
}
} }
void Update() void Update()
@ -286,7 +289,7 @@ public class SpeechRecognitionService : MonoBehaviour
this.speechConfig.SpeechRecognitionLanguage = languageCode; this.speechConfig.SpeechRecognitionLanguage = languageCode;
string micName = (Microphone.devices != null && Microphone.devices.Length > 0) ? Microphone.devices[0] : "<none>"; string micName = (Microphone.devices != null && Microphone.devices.Length > 0) ? Microphone.devices[0] : "<none>";
this.logIfInDebugMode($"SpeechRecognitionService initialized using microphone: {micName}"); this.logIfInDebugMode($"SpeechRecognitionService initialized using microphone: {micName} and languageCode {languageCode}");
this.SpeechRecognitionState = ESpeechRecognitionState.Ready; this.SpeechRecognitionState = ESpeechRecognitionState.Ready;
} }

View File

@ -144,6 +144,7 @@ public class ViaggioAIManager : MonoBehaviour
public void SetSpeechRecognitionLanguage(string languageCode) public void SetSpeechRecognitionLanguage(string languageCode)
{ {
this.LogIfInDebugMode($"ViaggioAIManager: Set speech language to {languageCode}");
this.SpeechRecognitionService.SetRecognitionLanguage(languageCode); this.SpeechRecognitionService.SetRecognitionLanguage(languageCode);
} }