use sample_rate
in process function
This commit is contained in:
parent
f5c4ff8c35
commit
c22eb1cd8f
1 changed files with 1 additions and 1 deletions
|
@ -98,7 +98,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
my_data.time += 1;
|
my_data.time += 1;
|
||||||
t
|
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 sine_freq = 440.0;
|
||||||
let pi2 = 2.0 * 3.141;
|
let pi2 = 2.0 * 3.141;
|
||||||
let phi = pi2 * time_secs * sine_freq;
|
let phi = pi2 * time_secs * sine_freq;
|
||||||
|
|
Loading…
Reference in a new issue