From f2bc9adc365c5488e0fdd0996d5bdc3027f34806 Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Wed, 19 Jul 2023 23:25:16 +1000 Subject: Minor fixes --- source/frontend/StarVoice.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'source/frontend/StarVoice.cpp') 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; } -- cgit v1.2.3