From fb96b2b03c524860ae879cf37c2ed9609be3cf7c Mon Sep 17 00:00:00 2001 From: ZarothYe Date: Mon, 27 Feb 2023 21:56:28 -0600 Subject: [PATCH] Add check of sound's current volume before sending subtitles --- Sources/Plasma/PubUtilLib/plAudio/plWin32Sound.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Sources/Plasma/PubUtilLib/plAudio/plWin32Sound.cpp b/Sources/Plasma/PubUtilLib/plAudio/plWin32Sound.cpp index 6cebf3c0..d3fbd148 100644 --- a/Sources/Plasma/PubUtilLib/plAudio/plWin32Sound.cpp +++ b/Sources/Plasma/PubUtilLib/plAudio/plWin32Sound.cpp @@ -117,7 +117,8 @@ void plWin32Sound::Update() uint32_t currentTimeMs = (uint32_t)(GetActualTimeSec() * 1000.0f); if (currentTimeMs <= srtReader->GetLastEntryEndTime()) { while (plSrtEntry* nextEntry = srtReader->GetNextEntryStartingBeforeTime(currentTimeMs)) { - if (plgAudioSys::AreSubtitlesEnabled()) { + float currVol = QueryCurrVolume(); + if (plgAudioSys::AreSubtitlesEnabled() && currVol > 0.01f) { // add a plSubtitleMsg to go... to whoever is listening (probably the KI) plSubtitleMsg* msg = new plSubtitleMsg(nextEntry->GetSubtitleText(), nextEntry->GetSpeakerName()); msg->Send();