This repository has been archived on 2025-08-02. You can view files and clone it, but cannot push or open issues or pull requests.
Files
Cryville.EEW.Unity/Assets/Cryville.EEW.Unity/TTSWorker.cs
2025-02-14 16:06:00 +08:00

26 lines
600 B
C#

using System;
using System.Globalization;
using System.Threading;
using System.Threading.Tasks;
namespace Cryville.EEW.Unity {
class TTSWorker : Core.TTSWorker {
public TTSWorker() : base(CreateSoundPlayer()) { }
static SoundPlayer CreateSoundPlayer() {
try {
return new SoundPlayer();
}
catch (InvalidOperationException) {
return null;
}
}
protected override bool IsSpeaking() => false;
protected override Task Speak(CultureInfo culture, string content, CancellationToken cancellationToken) => Task.CompletedTask;
protected override void StopCurrent() { }
}
}