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() { }
	}
}
