use audio_samples::{AudioProcessing, AudioStatistics, sine_wave};
use criterion::{Criterion, black_box, criterion_group, criterion_main};
use std::time::Duration;

fn bench_conversion_peak_and_scale(c: &mut Criterion) {
    let audio = sine_wave::<f32, f32>(880.0, Duration::from_secs_f32(0.25), 48000, 0.7);
    c.bench_function("conversion::peak", |b| b.iter(|| black_box(audio.peak())));

    c.bench_function("conversion::scale_clone", |b| {
        b.iter(|| {
            let mut a = audio.clone();
            a.scale(0.3f32);
            black_box(&a);
        })
    });
}

criterion_group!(benches, bench_conversion_peak_and_scale);
criterion_main!(benches);
