mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 09:49:15 +03:00
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.
This commit is contained in:
parent
43c37ae701
commit
1814f66c63
Notes:
sideshowbarker
2024-07-19 17:15:10 +09:00
Author: https://github.com/krkk Commit: https://github.com/SerenityOS/serenity/commit/1814f66c639 Pull-request: https://github.com/SerenityOS/serenity/pull/9792
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user