mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-10 01:59:31 +00:00
SoundPlayer: Cast Audio::Sample to float for fabsf()
This commit is contained in:
parent
7e6ac544f7
commit
61340c12d6
Notes:
sideshowbarker
2024-07-19 09:04:16 +09:00
Author: https://github.com/jcs
Commit: 61340c12d6
Pull-request: https://github.com/SerenityOS/serenity/pull/1233
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/bugaevc
1 changed files with 1 additions and 1 deletions
|
@ -54,7 +54,7 @@ void SampleWidget::paint_event(GUI::PaintEvent& event)
|
||||||
if (m_buffer) {
|
if (m_buffer) {
|
||||||
int samples_per_pixel = m_buffer->sample_count() / frame_inner_rect().width();
|
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) {
|
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);
|
sample_max = max(sample, sample_max);
|
||||||
++count;
|
++count;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue