From 0db8f3aaa49714f313aaceecd668947257759276 Mon Sep 17 00:00:00 2001 From: Spatison <137375981+Spatison@users.noreply.github.com> Date: Wed, 4 Dec 2024 06:05:04 +1000 Subject: [PATCH] [Port] TTS (#121) * add: TTS * WD EDIT * add: TTS prototypes * fix * fix 100% --- Content.Client/Audio/ContentAudioSystem.cs | 1 + Content.Client/Entry/EntryPoint.cs | 3 + Content.Client/IoC/ClientContentIoC.cs | 2 + .../Lobby/UI/HumanoidProfileEditor.xaml | 9 + .../Lobby/UI/HumanoidProfileEditor.xaml.cs | 18 + Content.Client/Options/UI/Tabs/AudioTab.xaml | 15 + .../Options/UI/Tabs/AudioTab.xaml.cs | 4 + .../_White/TTS/HumanoidProfileEditor.TTS.cs | 77 + Content.Client/_White/TTS/TTSManager.cs | 24 + Content.Client/_White/TTS/TTSSystem.cs | 130 ++ .../Tests/Preferences/ServerDbSqliteTests.cs | 1 + .../20241105191142_TtsVoices.Designer.cs | 1820 +++++++++++++++++ .../Postgres/20241105191142_TtsVoices.cs | 29 + .../PostgresServerDbContextModelSnapshot.cs | 7 + .../20241105191222_TtsVoices.Designer.cs | 1749 ++++++++++++++++ .../Sqlite/20241105191222_TtsVoices.cs | 29 + .../SqliteServerDbContextModelSnapshot.cs | 7 + Content.Server.Database/Model.cs | 1 + Content.Server/Database/ServerDbBase.cs | 8 + Content.Server/Entry/EntryPoint.cs | 2 + Content.Server/IoC/ServerContentIoC.cs | 2 + Content.Server/_White/TTS/TTSManager.cs | 182 ++ .../_White/TTS/TTSSystem.Sanitize.cs | 249 +++ Content.Server/_White/TTS/TTSSystem.cs | 231 +++ .../Humanoid/HumanoidAppearanceComponent.cs | 6 + .../SharedHumanoidAppearanceSystem.cs | 40 + .../Preferences/HumanoidCharacterProfile.cs | 32 + Content.Shared/_White/CVars.cs | 25 + .../_White/TTS/Events/PlayTTSEvent.cs | 14 + .../_White/TTS/Events/RequestTTSEvent.cs | 10 + Content.Shared/_White/TTS/MsgRequestTTS.cs | 30 + Content.Shared/_White/TTS/TTSComponent.cs | 11 + .../_White/TTS/TTSPitchRateSystem.cs | 40 + .../_White/TTS/TTSVoicePrototype.cs | 33 + .../escape-menu/{ => ui}/options-menu.ftl | 4 + .../en-US/_white/escape-menu/ui/options.ftl | 1 - .../ui/humanoid-profile-editor.ftl | 1 + .../_white/prototypes/voice/tts_voices.ftl | 45 + .../escape-menu/{ => ui}/options-menu.ftl | 4 + .../ru-RU/_white/escape-menu/ui/options.ftl | 1 - .../ui/humanoid-profile-editor.ftl | 1 + .../_white/prototypes/voice/tts_voices.ftl | 45 + .../Prototypes/_White/Voice/tts_voices.yml | 335 +++ 43 files changed, 5276 insertions(+), 2 deletions(-) create mode 100644 Content.Client/_White/TTS/HumanoidProfileEditor.TTS.cs create mode 100644 Content.Client/_White/TTS/TTSManager.cs create mode 100644 Content.Client/_White/TTS/TTSSystem.cs create mode 100644 Content.Server.Database/Migrations/Postgres/20241105191142_TtsVoices.Designer.cs create mode 100644 Content.Server.Database/Migrations/Postgres/20241105191142_TtsVoices.cs create mode 100644 Content.Server.Database/Migrations/Sqlite/20241105191222_TtsVoices.Designer.cs create mode 100644 Content.Server.Database/Migrations/Sqlite/20241105191222_TtsVoices.cs create mode 100644 Content.Server/_White/TTS/TTSManager.cs create mode 100644 Content.Server/_White/TTS/TTSSystem.Sanitize.cs create mode 100644 Content.Server/_White/TTS/TTSSystem.cs create mode 100644 Content.Shared/_White/TTS/Events/PlayTTSEvent.cs create mode 100644 Content.Shared/_White/TTS/Events/RequestTTSEvent.cs create mode 100644 Content.Shared/_White/TTS/MsgRequestTTS.cs create mode 100644 Content.Shared/_White/TTS/TTSComponent.cs create mode 100644 Content.Shared/_White/TTS/TTSPitchRateSystem.cs create mode 100644 Content.Shared/_White/TTS/TTSVoicePrototype.cs rename Resources/Locale/en-US/_white/escape-menu/{ => ui}/options-menu.ftl (57%) delete mode 100644 Resources/Locale/en-US/_white/escape-menu/ui/options.ftl create mode 100644 Resources/Locale/en-US/_white/preferences/ui/humanoid-profile-editor.ftl create mode 100644 Resources/Locale/en-US/_white/prototypes/voice/tts_voices.ftl rename Resources/Locale/ru-RU/_white/escape-menu/{ => ui}/options-menu.ftl (59%) delete mode 100644 Resources/Locale/ru-RU/_white/escape-menu/ui/options.ftl create mode 100644 Resources/Locale/ru-RU/_white/preferences/ui/humanoid-profile-editor.ftl create mode 100644 Resources/Locale/ru-RU/_white/prototypes/voice/tts_voices.ftl create mode 100644 Resources/Prototypes/_White/Voice/tts_voices.yml diff --git a/Content.Client/Audio/ContentAudioSystem.cs b/Content.Client/Audio/ContentAudioSystem.cs index a79ff74e79..e9ccec3041 100644 --- a/Content.Client/Audio/ContentAudioSystem.cs +++ b/Content.Client/Audio/ContentAudioSystem.cs @@ -30,6 +30,7 @@ public sealed partial class ContentAudioSystem : SharedContentAudioSystem public const float LobbyMultiplier = 3f; public const float InterfaceMultiplier = 2f; public const float AnnouncerMultiplier = 3f; + public const float TTSMultiplier = 1f; // WD EDIT public override void Initialize() { diff --git a/Content.Client/Entry/EntryPoint.cs b/Content.Client/Entry/EntryPoint.cs index bf5f021be3..b9c7ab5b7d 100644 --- a/Content.Client/Entry/EntryPoint.cs +++ b/Content.Client/Entry/EntryPoint.cs @@ -1,3 +1,4 @@ +using Content.Client._White.TTS; using Content.Client.Administration.Managers; using Content.Client.Changelog; using Content.Client.Chat.Managers; @@ -72,6 +73,7 @@ public sealed class EntryPoint : GameClient [Dependency] private readonly ILogManager _logManager = default!; [Dependency] private readonly JoinQueueManager _joinQueue = default!; [Dependency] private readonly DiscordAuthManager _discordAuth = default!; + [Dependency] private readonly TTSManager _ttsManager = default!; // WD EDIT public override void Init() { @@ -166,6 +168,7 @@ public override void PostInit() _documentParsingManager.Initialize(); _joinQueue.Initialize(); _discordAuth.Initialize(); + _ttsManager.Initialize(); // WD EDIT _baseClient.RunLevelChanged += (_, args) => { diff --git a/Content.Client/IoC/ClientContentIoC.cs b/Content.Client/IoC/ClientContentIoC.cs index 80c04cda04..df3833eb60 100644 --- a/Content.Client/IoC/ClientContentIoC.cs +++ b/Content.Client/IoC/ClientContentIoC.cs @@ -1,3 +1,4 @@ +using Content.Client._White.TTS; using Content.Client.Administration.Managers; using Content.Client.Changelog; using Content.Client.Chat.Managers; @@ -52,6 +53,7 @@ public static void Register() collection.Register(); IoCManager.Register(); IoCManager.Register(); + IoCManager.Register(); // WD EDIT } } } diff --git a/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml b/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml index 2da2904435..687d5c45e5 100644 --- a/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml +++ b/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml @@ -80,6 +80,15 @@ + + + +