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

summaryrefslogtreecommitdiff
path: root/source/frontend/StarVoice.cpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2023-07-19 23:25:16 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2023-07-19 23:25:16 +1000
commitf2bc9adc365c5488e0fdd0996d5bdc3027f34806 (patch)
tree4ee972c0194c165c79a848876eb7c36f70bbdf22 /source/frontend/StarVoice.cpp
parent1f038540a59ff96aed3cda901449a298b6f1c11c (diff)
Minor fixes
Diffstat (limited to 'source/frontend/StarVoice.cpp')
-rw-r--r--source/frontend/StarVoice.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/source/frontend/StarVoice.cpp b/source/frontend/StarVoice.cpp
index 843203f..4a0e344 100644
--- a/source/frontend/StarVoice.cpp
+++ b/source/frontend/StarVoice.cpp
@@ -314,22 +314,18 @@ void Voice::readAudioData(uint8_t* stream, int len) {
if (active) {
float decibels = getAudioLoudness((int16_t*)stream, sampleCount);
- if (!m_loopback)
- m_clientSpeaker->decibelLevel = getAudioLoudness((int16_t*)stream, sampleCount, m_inputVolume);
-
if (m_inputMode == VoiceInputMode::VoiceActivity) {
if (decibels > m_threshold)
m_lastThresholdTime = now;
active = now - m_lastThresholdTime < 50;
}
}
- else if (!m_loopback)
- m_clientSpeaker->decibelLevel = -96.0f;
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;
}