From ce7be460ea0e3d9fad5239bbbfcddd353889f81a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A2=D0=B8=D1=82=D0=BE=D0=B2=20=D0=92=D1=8F=D1=87=D0=B5?= =?UTF-8?q?=D1=81=D0=BB=D0=B0=D0=B2=20=D0=92=D0=B8=D1=82=D0=B0=D0=BB=D1=8C?= =?UTF-8?q?=D0=B5=D0=B2=D0=B8=D1=87?= Date: Tue, 20 Jun 2023 15:48:56 +0300 Subject: [PATCH] Changes in behavior of whisper in radio TTS events. --- Content.Server/Corvax/TTS/TTSSystem.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Content.Server/Corvax/TTS/TTSSystem.cs b/Content.Server/Corvax/TTS/TTSSystem.cs index 2055a7307d4520..d538a9ea4f2b1a 100644 --- a/Content.Server/Corvax/TTS/TTSSystem.cs +++ b/Content.Server/Corvax/TTS/TTSSystem.cs @@ -113,9 +113,9 @@ private async void OnEntitySpoke(EntityUid uid, TTSComponent component, EntitySp if (!_prototypeManager.TryIndex(voiceId, out var protoVoice)) return; - if (args.ObfuscatedMessage != null && !args.IsRadio) + if (args.ObfuscatedMessage != null) { - HandleWhisper(uid, args.Message, args.ObfuscatedMessage, protoVoice.Speaker); + HandleWhisper(uid, args.Message, protoVoice.Speaker, args.IsRadio); return; } @@ -129,9 +129,11 @@ private async void HandleSay(EntityUid uid, string message, string speaker) RaiseNetworkEvent(new PlayTTSEvent(uid, soundData, false), Filter.Pvs(uid)); } - private async void HandleWhisper(EntityUid uid, string message, string obfMessage, string speaker) + private async void HandleWhisper(EntityUid uid, string message, string speaker, bool isRadio) { - var soundData = await GenerateTTS(message, speaker, true); + // If it's a whisper into a radio, generate speech without whisper + // attributes to prevent an additional speech synthesis event + var soundData = await GenerateTTS(message, speaker, isWhisper: !isRadio); if (soundData is null) return;