diff --git a/01-play-sine/src/main.rs b/01-play-sine/src/main.rs index 6ede0bf..be2a3bd 100644 --- a/01-play-sine/src/main.rs +++ b/01-play-sine/src/main.rs @@ -98,7 +98,7 @@ fn main() -> Result<(), Box> { my_data.time += 1; t }; - let time_secs = (time_samples as f32) / 48000.0 as f32; + let time_secs = (time_samples as f32) / (sample_rate as f32); let sine_freq = 440.0; let pi2 = 2.0 * 3.141; let phi = pi2 * time_secs * sine_freq;