Add proper error handling

This commit is contained in:
Pierre Krieger 2015-09-01 14:17:57 +02:00
parent 1985c346ac
commit 98b931edff
4 changed files with 117 additions and 27 deletions

View file

@ -2,7 +2,7 @@ extern crate cpal;
fn main() {
let endpoint = cpal::get_default_endpoint().unwrap();
let format = endpoint.get_supported_formats_list().next().unwrap();
let format = endpoint.get_supported_formats_list().unwrap().next().unwrap();
let mut channel = cpal::Voice::new(&endpoint, &format).unwrap();
// Produce a sinusoid of maximum amplitude.