2015-09-22 12:43:30 +00:00
|
|
|
extern crate cpal;
|
|
|
|
|
|
|
|
fn main() {
|
2018-01-26 12:49:47 +00:00
|
|
|
println!("Default Endpoint:\n {:?}", cpal::default_endpoint().map(|e| e.name()));
|
2017-10-11 11:24:49 +00:00
|
|
|
|
2018-01-26 12:49:47 +00:00
|
|
|
let endpoints = cpal::endpoints();
|
2015-09-22 12:43:30 +00:00
|
|
|
println!("Endpoints: ");
|
|
|
|
for (endpoint_index, endpoint) in endpoints.enumerate() {
|
2017-10-11 11:24:49 +00:00
|
|
|
println!("{}. Endpoint \"{}\" Audio formats: ",
|
|
|
|
endpoint_index + 1,
|
|
|
|
endpoint.name());
|
2015-09-22 12:46:27 +00:00
|
|
|
|
2017-10-11 08:39:44 +00:00
|
|
|
let formats = match endpoint.supported_formats() {
|
2015-09-22 13:46:56 +00:00
|
|
|
Ok(f) => f,
|
2017-10-11 11:24:49 +00:00
|
|
|
Err(e) => {
|
|
|
|
println!("Error: {:?}", e);
|
|
|
|
continue;
|
|
|
|
},
|
2015-09-22 13:46:56 +00:00
|
|
|
};
|
|
|
|
|
2015-09-22 12:43:30 +00:00
|
|
|
for (format_index, format) in formats.enumerate() {
|
2015-09-22 12:46:27 +00:00
|
|
|
println!("{}.{}. {:?}", endpoint_index + 1, format_index + 1, format);
|
2015-09-22 12:43:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|