Skip to content

Commit

Permalink
фикс громкости ТТС
Browse files Browse the repository at this point in the history
  • Loading branch information
VigersRay committed Jun 9, 2024
1 parent d604905 commit b851589
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions Content.Client/_Sunrise/TTS/TTSSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ public sealed class TTSSystem : EntitySystem
private readonly MemoryContentRoot _contentRoot = new();
private static readonly ResPath Prefix = ResPath.Root / "TTS";

private const float TtsVolume = 0f;
private const float AnnounceVolume = 0f;

private float _volume;
private float _radioVolume;
private int _fileIdx;
Expand Down Expand Up @@ -101,7 +98,7 @@ private void PlayNextInQueue()
if (_announcementUid == EntityUid.Invalid)
_announcementUid = Spawn(null);

var finalParams = new AudioParams() { Volume = AnnounceVolume + SharedAudioSystem.GainToVolume(_volumeAnnounce) };
var finalParams = new AudioParams() { Volume = _volumeAnnounce + SharedAudioSystem.GainToVolume(_volumeAnnounce) };

if (ev.AnnouncementSound != null)
{
Expand All @@ -122,7 +119,7 @@ private void OnPlayTTS(PlayTTSEvent ev)
if (volume == 0)
return;

volume = TtsVolume + SharedAudioSystem.GainToVolume(volume * ev.VolumeModifier);
volume = _volume + SharedAudioSystem.GainToVolume(volume * ev.VolumeModifier);

var audioParams = AudioParams.Default.WithVolume(volume);

Expand Down

0 comments on commit b851589

Please sign in to comment.