Update examples to use std Termination
This commit is contained in:
parent
a733bdb4f9
commit
0b6e66d38e
4 changed files with 37 additions and 30 deletions
|
|
@ -1,11 +1,12 @@
|
|||
extern crate cpal;
|
||||
extern crate failure;
|
||||
|
||||
fn main() {
|
||||
let device = cpal::default_output_device().expect("Failed to get default output device");
|
||||
let format = device.default_output_format().expect("Failed to get default output format");
|
||||
fn main() -> Result<(), failure::Error> {
|
||||
let device = cpal::default_output_device().expect("failed to find a default output device");
|
||||
let format = device.default_output_format()?;
|
||||
let event_loop = cpal::EventLoop::new();
|
||||
let stream_id = event_loop.build_output_stream(&device, &format).unwrap();
|
||||
event_loop.play_stream(stream_id.clone()).unwrap();
|
||||
let stream_id = event_loop.build_output_stream(&device, &format)?;
|
||||
event_loop.play_stream(stream_id.clone())?;
|
||||
|
||||
let sample_rate = format.sample_rate.0 as f32;
|
||||
let mut sample_clock = 0f32;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue