diff --git a/src/engine.rs b/src/engine.rs index 2e9964d..68e8462 100644 --- a/src/engine.rs +++ b/src/engine.rs @@ -75,29 +75,14 @@ impl Engine { let f1 = f1.unwrap(); // we privilege f32 formats to avoid a conversion - if f1.data_type == cpal::SampleFormat::F32 && f2.data_type != cpal::SampleFormat::F32 { - return Some(f1); - } if f2.data_type == cpal::SampleFormat::F32 && f1.data_type != cpal::SampleFormat::F32 { return Some(f2); } - if f1.channels.len() < f2.channels.len() { + // priviledge outputs with 2 channels for now + if f2.channels.len() == 2 && f1.channels.len() != 2 { return Some(f2); } - if f2.channels.len() < f1.channels.len() { - return Some(f1); - } - if f2.channels.len() > 7 { // TODO: not proper - return Some(f1); - } - - if f1.samples_rate.0 < 44100 && f2.samples_rate.0 >= 44100 { - return Some(f2); - } - if f2.samples_rate.0 < 44100 && f1.samples_rate.0 >= 44100 { - return Some(f1); - } Some(f1) }).expect("The endpoint doesn't support any format!?");