Files
wwdpublic/Content.Shared/_White/TTS/TTSSerializable.cs
Spatison 06af98c88b [Tweak/Fix] TTS (#479)
* tweak tts

* krolik ymni
2025-04-27 17:00:06 +03:00

44 lines
1.3 KiB
C#

using Robust.Shared.Audio;
using Robust.Shared.Serialization;
namespace Content.Shared._White.TTS;
public enum VoiceRequestType
{
None,
Preview
}
[Serializable, NetSerializable]
// ReSharper disable once InconsistentNaming
public sealed class PlayTTSEvent(byte[] data, NetEntity? sourceUid = null, bool isWhisper = false) : EntityEventArgs
{
public byte[] Data { get; } = data;
public NetEntity? SourceUid { get; } = sourceUid;
public bool IsWhisper { get; } = isWhisper;
}
// ReSharper disable once InconsistentNaming
[Serializable, NetSerializable]
public sealed class RequestGlobalTTSEvent(VoiceRequestType text, string voiceId) : EntityEventArgs
{
public VoiceRequestType Text { get;} = text;
public string VoiceId { get; } = voiceId;
}
// ReSharper disable once InconsistentNaming
[Serializable, NetSerializable]
public sealed class RequestPreviewTTSEvent(string voiceId) : EntityEventArgs
{
public string VoiceId { get; } = voiceId;
}
// ReSharper disable once InconsistentNaming
[Serializable, NetSerializable]
public sealed class AnnounceTTSEvent(byte[] data, string announcementSound, AudioParams announcementParams) : EntityEventArgs
{
public byte[] Data { get; } = data;
public string AnnouncementSound { get; } = announcementSound;
public AudioParams AnnouncementParams{ get; } = announcementParams;
}