From d2b2f2e7083e2b2c4ee18aee15dc68ba61f0183c Mon Sep 17 00:00:00 2001 From: PopSlime Date: Sun, 27 Jul 2025 11:24:43 +0800 Subject: [PATCH] feat: Adapt to breaking changes --- Assets/Cryville.EEW.Unity/TTSWorker.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Assets/Cryville.EEW.Unity/TTSWorker.cs b/Assets/Cryville.EEW.Unity/TTSWorker.cs index 92575d0..83f820f 100644 --- a/Assets/Cryville.EEW.Unity/TTSWorker.cs +++ b/Assets/Cryville.EEW.Unity/TTSWorker.cs @@ -1,8 +1,6 @@ using SpeechLib; using System; using System.Globalization; -using System.Threading; -using System.Threading.Tasks; namespace Cryville.EEW.Unity { class TTSWorker : Core.Audio.TTSWorker { @@ -33,15 +31,14 @@ namespace Cryville.EEW.Unity { return (status.dwRunningState & (uint)SpeechRunState.SRSEIsSpeaking) != 0; } - protected override Task Speak(CultureInfo culture, string content, CancellationToken cancellationToken) { - if (_voice == null) return Task.CompletedTask; + protected override void BeginSpeak(CultureInfo culture, string content) { + if (_voice == null) return; _voice.Speak( string.Format(CultureInfo.InvariantCulture, "{1}", culture.LCID, content), (uint)(SpeechVoiceSpeakFlags.SVSFlagsAsync | SpeechVoiceSpeakFlags.SVSFPurgeBeforeSpeak), out _ ); App.MainLogger.Log(0, "Audio", null, "TTS ({0}): {1}", culture, content); - return Task.CompletedTask; } protected override void StopCurrent() {