diff options
author | Karol Kosek <krkk@krkk.ct8.pl> | 2021-09-03 23:04:56 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-09-04 22:52:02 +0200 |
commit | 1814f66c639da503abeb01114827570e817636eb (patch) | |
tree | 8e026a59a21f8df4fa3bd557c673343e5d864afb /Userland/Applications | |
parent | 43c37ae7016003ba841d709a467459be26a88fac (diff) | |
download | serenity-1814f66c639da503abeb01114827570e817636eb.zip |
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.
Diffstat (limited to 'Userland/Applications')
-rw-r--r-- | Userland/Applications/SoundPlayer/BarsVisualizationWidget.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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<double, group_count> groups; |