2024-01-28 18:37:24 +07:00
|
|
|
|
using Content.Shared._White.TTS;
|
2023-05-04 17:51:53 +03:00
|
|
|
|
using Robust.Shared.Network;
|
|
|
|
|
|
|
2024-01-28 17:32:55 +07:00
|
|
|
|
namespace Content.Client._White.TTS;
|
2023-05-04 17:51:53 +03:00
|
|
|
|
|
|
|
|
|
|
// ReSharper disable once InconsistentNaming
|
|
|
|
|
|
public sealed class TTSManager
|
|
|
|
|
|
{
|
|
|
|
|
|
[Dependency] private readonly IClientNetManager _netMgr = default!;
|
2024-04-20 12:38:13 +07:00
|
|
|
|
[Dependency] private readonly EntityManager _entityManager = default!;
|
2023-05-04 17:51:53 +03:00
|
|
|
|
|
|
|
|
|
|
public void Initialize()
|
|
|
|
|
|
{
|
|
|
|
|
|
_netMgr.RegisterNetMessage<MsgRequestTTS>();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ReSharper disable once InconsistentNaming
|
|
|
|
|
|
public void RequestTTS(EntityUid uid, string text, string voiceId)
|
|
|
|
|
|
{
|
2024-04-20 12:38:13 +07:00
|
|
|
|
var netEntity = _entityManager.GetNetEntity(uid);
|
|
|
|
|
|
var msg = new MsgRequestTTS() { Text = text, Uid = netEntity, VoiceId = voiceId };
|
2023-05-04 17:51:53 +03:00
|
|
|
|
_netMgr.ClientSendMessage(msg);
|
|
|
|
|
|
}
|
2024-04-20 12:38:13 +07:00
|
|
|
|
}
|