Browse Source

Add check of sound's current volume before sending subtitles

tickets/50/50/1
ZarothYe 1 year ago
parent
commit
fb96b2b03c
  1. 3
      Sources/Plasma/PubUtilLib/plAudio/plWin32Sound.cpp

3
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();

Loading…
Cancel
Save