Skip to content

Commit

Permalink
SoundPlayer: Cast Audio::Sample to float for fabsf()
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs authored and awesomekling committed Feb 25, 2020
1 parent 7e6ac54 commit 61340c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Applications/SoundPlayer/SampleWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void SampleWidget::paint_event(GUI::PaintEvent& event)
if (m_buffer) {
int samples_per_pixel = m_buffer->sample_count() / frame_inner_rect().width();
for (int sample_index = 0; sample_index < m_buffer->sample_count() && (x - x_offset) < frame_inner_rect().width(); ++sample_index) {
float sample = fabsf(m_buffer->samples()[sample_index].left);
float sample = fabsf((float)m_buffer->samples()[sample_index].left);

sample_max = max(sample, sample_max);
++count;
Expand Down

0 comments on commit 61340c1

Please sign in to comment.