Update ringbuf dev-dependency
This commit is contained in:
parent
b9a19d9f6e
commit
3ccbcb843c
2 changed files with 7 additions and 10 deletions
|
|
@ -17,7 +17,7 @@ thiserror = "1.0.2"
|
|||
[dev-dependencies]
|
||||
anyhow = "1.0.12"
|
||||
hound = "3.4"
|
||||
ringbuf = "0.1.6"
|
||||
ringbuf = "0.2"
|
||||
|
||||
[target.'cfg(target_os = "windows")'.dependencies]
|
||||
winapi = { version = "0.3", features = ["audiosessiontypes", "audioclient", "coml2api", "combaseapi", "debug", "devpkey", "handleapi", "ksmedia", "mmdeviceapi", "objbase", "profileapi", "std", "synchapi", "winbase", "winuser"] }
|
||||
|
|
|
|||
|
|
@ -84,21 +84,18 @@ fn main() -> Result<(), anyhow::Error> {
|
|||
};
|
||||
|
||||
let output_data_fn = move |data: &mut [f32], _: &cpal::OutputCallbackInfo| {
|
||||
let mut input_fell_behind = None;
|
||||
let mut input_fell_behind = false;
|
||||
for sample in data {
|
||||
*sample = match consumer.pop() {
|
||||
Ok(s) => s,
|
||||
Err(err) => {
|
||||
input_fell_behind = Some(err);
|
||||
Some(s) => s,
|
||||
None => {
|
||||
input_fell_behind = true;
|
||||
0.0
|
||||
}
|
||||
};
|
||||
}
|
||||
if let Some(err) = input_fell_behind {
|
||||
eprintln!(
|
||||
"input stream fell behind: {:?}: try increasing latency",
|
||||
err
|
||||
);
|
||||
if input_fell_behind {
|
||||
eprintln!("input stream fell behind: try increasing latency");
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue