From bed0bbb78542a3ffae9edd24c1543739e8907443 Mon Sep 17 00:00:00 2001 From: Spatison <137375981+Spatison@users.noreply.github.com> Date: Tue, 5 Nov 2024 20:08:41 +0300 Subject: [PATCH 1/5] add: TTS --- 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 | 20 +- 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 + .../_white/escape-menu/ui/options-menu.ftl | 7 + .../en-US/_white/escape-menu/ui/options.ftl | 1 - .../ui/humanoid-profile-editor.ftl | 1 + .../_white/prototypes/voice/tts_voices.ftl | 3 + .../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 | 3 + .../Prototypes/_White/Voice/tts_voices.yml | 17 + 43 files changed, 4878 insertions(+), 3 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 create mode 100644 Resources/Locale/en-US/_white/escape-menu/ui/options-menu.ftl 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 1ab213ae0a..c655c0e402 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; @@ -74,6 +75,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() { @@ -169,6 +171,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 8c2b676c2e..abe758c822 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; @@ -54,6 +55,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 @@ + + + +