mirror of
https://github.com/mii443/maudio-router.git
synced 2025-08-23 00:15:37 +00:00
cannot read mic input
This commit is contained in:
@ -108,10 +108,11 @@ pub fn run(run: Run) {
|
||||
let config = device.default_input_config().unwrap();
|
||||
let channels = config.channels();
|
||||
let virtual_devices = virtual_devices.iter().filter(|device| device.lock().unwrap().name == input_route.virtual_device).map(|d| d.clone()).collect::<Vec<_>>();
|
||||
let mut stream = device.build_input_stream(
|
||||
let stream = device.build_input_stream(
|
||||
&config.into(),
|
||||
{
|
||||
move |data, _| {
|
||||
println!("Reading input stream");
|
||||
for (i, buffer) in data.chunks(channels as usize).enumerate() {
|
||||
let buffer = buffer.to_vec();
|
||||
for virtual_device in &virtual_devices {
|
||||
@ -123,6 +124,7 @@ pub fn run(run: Run) {
|
||||
move |err| eprintln!("An error occurred on the input stream: {}", err),
|
||||
None
|
||||
).unwrap();
|
||||
println!("Playing input stream");
|
||||
stream.play().unwrap();
|
||||
}
|
||||
crate::config::Device::Remote { remote } => {
|
||||
@ -130,4 +132,6 @@ pub fn run(run: Run) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::thread::sleep(std::time::Duration::from_secs(10));
|
||||
}
|
||||
|
Reference in New Issue
Block a user