From 1814f66c639da503abeb01114827570e817636eb Mon Sep 17 00:00:00 2001 From: Karol Kosek Date: Fri, 3 Sep 2021 23:04:56 +0200 Subject: [PATCH] SoundPlayer: Convert to double before calculating freq_bin was converted to double after it was calculated, so there was a much higher probability it could be 0 instead of some comma number, which meant that the bars always stayed on top. --- Userland/Applications/SoundPlayer/BarsVisualizationWidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Applications/SoundPlayer/BarsVisualizationWidget.cpp b/Userland/Applications/SoundPlayer/BarsVisualizationWidget.cpp index 587763b7ea..4c0a584768 100644 --- a/Userland/Applications/SoundPlayer/BarsVisualizationWidget.cpp +++ b/Userland/Applications/SoundPlayer/BarsVisualizationWidget.cpp @@ -28,7 +28,7 @@ void BarsVisualizationWidget::paint_event(GUI::PaintEvent& event) fft(m_sample_buffer, false); double max = AK::sqrt(m_sample_count * 2.); - double freq_bin = m_samplerate / m_sample_count; + double freq_bin = m_samplerate / (double)m_sample_count; constexpr int group_count = 60; Vector groups;