mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-21 07:28:31 +03:00
* Revert "[Fix] TTS (#137)" This reverts commitc5bd6b70a2. * Revert "[Fix] Исправление ТТСа (#136)" This reverts commit3759acb84e. * Revert "[Port] TTS (#121)" This reverts commit0db8f3aaa4. * new TTS * new TTS * new TTS * new TTS * fix
50 lines
1.5 KiB
C#
50 lines
1.5 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;
|
|
}
|
|
|
|
[Serializable, NetSerializable]
|
|
public sealed class VoiceMaskChangeVoiceMessage(string voice) : BoundUserInterfaceMessage
|
|
{
|
|
public string Voice = voice;
|
|
}
|
|
|
|
// 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;
|
|
}
|