diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-07-20 14:55:38 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-07-20 14:55:38 +1000 |
commit | 043db1841ee46ace0f6919bfdf6ac20a539faaca (patch) | |
tree | f52f2cc2aa2759f38d244177d9fb56bab29b4ace /source/frontend/StarVoice.cpp | |
parent | 3aa45ab7995c000432bba8ee1335ff7db923ac41 (diff) |
Voice: Minor options menu fixes, fix decibel level freezing on muted speakers
Diffstat (limited to 'source/frontend/StarVoice.cpp')
-rw-r--r-- | source/frontend/StarVoice.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/source/frontend/StarVoice.cpp b/source/frontend/StarVoice.cpp index fdc10ea..82205bd 100644 --- a/source/frontend/StarVoice.cpp +++ b/source/frontend/StarVoice.cpp @@ -362,13 +362,14 @@ void Voice::mix(int16_t* buffer, size_t frameCount, unsigned channels) { VoiceAudioStream* audio = speaker->audioStream.get(); MutexLocker audioLock(audio->mutex); if (speaker->playing && !audio->samples.empty()) { + for (size_t i = 0; i != samples; ++i) + speakerBuffer[i] = audio->take(); + + if (speaker != m_clientSpeaker) + speaker->decibelLevel = getAudioLoudness(speakerBuffer.data(), samples); + if (!speaker->muted) { mix = true; - for (size_t i = 0; i != samples; ++i) - speakerBuffer[i] = audio->take(); - - if (speaker != m_clientSpeaker) - speaker->decibelLevel = getAudioLoudness(speakerBuffer.data(), samples); float volume = speaker->volume; Array2F levels = speaker->channelVolumes; @@ -396,10 +397,6 @@ void Voice::mix(int16_t* buffer, size_t frameCount, unsigned channels) { } //*/ } - else { - for (size_t i = 0; i != samples; ++i) - audio->take(); - } ++it; } else { |