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]
|
[dev-dependencies]
|
||||||
anyhow = "1.0.12"
|
anyhow = "1.0.12"
|
||||||
hound = "3.4"
|
hound = "3.4"
|
||||||
ringbuf = "0.1.6"
|
ringbuf = "0.2"
|
||||||
|
|
||||||
[target.'cfg(target_os = "windows")'.dependencies]
|
[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"] }
|
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 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 {
|
for sample in data {
|
||||||
*sample = match consumer.pop() {
|
*sample = match consumer.pop() {
|
||||||
Ok(s) => s,
|
Some(s) => s,
|
||||||
Err(err) => {
|
None => {
|
||||||
input_fell_behind = Some(err);
|
input_fell_behind = true;
|
||||||
0.0
|
0.0
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if let Some(err) = input_fell_behind {
|
if input_fell_behind {
|
||||||
eprintln!(
|
eprintln!("input stream fell behind: try increasing latency");
|
||||||
"input stream fell behind: {:?}: try increasing latency",
|
|
||||||
err
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue