Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add telephone tts #2888

Merged
merged 3 commits into from
Jan 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Content.Server/Telephone/TelephoneSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Content.Server.Speech;
using Content.Server.Speech.Components;
using Content.Shared.Chat;
using Content.Shared.Corvax.TTS;
using Content.Shared.Database;
using Content.Shared.Mind.Components;
using Content.Shared.Power;
Expand Down Expand Up @@ -109,6 +110,18 @@ private void OnTelephoneMessageReceived(Entity<TelephoneComponent> entity, ref T
("originalName", nameEv.VoiceName));

var volume = entity.Comp.SpeakerVolume == TelephoneVolume.Speak ? InGameICChatType.Speak : InGameICChatType.Whisper;
// Corvax-TTS-Start
// If speaker entity has TTS, the telephone will speak with the same voice
if(TryComp<TTSComponent>(args.MessageSource, out var ttsSpeaker))
{
EntityManager.EnsureComponent<TTSComponent>(entity, out var ttsTelephone);
ttsTelephone.VoicePrototypeId = ttsSpeaker.VoicePrototypeId;
}
else // Remove TTS if the speaker has no TTS
{
EntityManager.RemoveComponent<TTSComponent>(entity);
}
// Corvax-TTS-End
_chat.TrySendInGameICMessage(entity, args.Message, volume, ChatTransmitRange.GhostRangeLimit, nameOverride: name, checkRadioPrefix: false);
}

Expand Down
Loading