Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/frontend
diff options
context:
space:
mode:
Diffstat (limited to 'source/frontend')
-rw-r--r--source/frontend/StarVoice.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/source/frontend/StarVoice.cpp b/source/frontend/StarVoice.cpp
index 44e62cb..fdc10ea 100644
--- a/source/frontend/StarVoice.cpp
+++ b/source/frontend/StarVoice.cpp
@@ -321,11 +321,12 @@ void Voice::readAudioData(uint8_t* stream, int len) {
}
}
+ m_clientSpeaker->decibelLevel = getAudioLoudness((int16_t*)stream, sampleCount, m_inputVolume);
+
if (!m_loopback) {
if (active && !m_clientSpeaker->playing)
m_clientSpeaker->lastPlayTime = now;
- m_clientSpeaker->decibelLevel = getAudioLoudness((int16_t*)stream, sampleCount, m_inputVolume);
m_clientSpeaker->playing = active;
}
@@ -366,7 +367,8 @@ void Voice::mix(int16_t* buffer, size_t frameCount, unsigned channels) {
for (size_t i = 0; i != samples; ++i)
speakerBuffer[i] = audio->take();
- speaker->decibelLevel = getAudioLoudness(speakerBuffer.data(), samples);
+ if (speaker != m_clientSpeaker)
+ speaker->decibelLevel = getAudioLoudness(speakerBuffer.data(), samples);
float volume = speaker->volume;
Array2F levels = speaker->channelVolumes;
@@ -402,7 +404,8 @@ void Voice::mix(int16_t* buffer, size_t frameCount, unsigned channels) {
}
else {
speaker->playing = false;
- speaker->decibelLevel = -96.0f;
+ if (speaker != m_clientSpeaker)
+ speaker->decibelLevel = -96.0f;
it = m_activeSpeakers.erase(it);
}
}