Add supported formats enumeration
This commit is contained in:
parent
47f966bf75
commit
1985c346ac
5 changed files with 185 additions and 44 deletions
|
|
@ -1,7 +1,9 @@
|
|||
extern crate cpal;
|
||||
|
||||
fn main() {
|
||||
let mut channel = cpal::Voice::new(&cpal::get_default_endpoint().unwrap()).unwrap();
|
||||
let endpoint = cpal::get_default_endpoint().unwrap();
|
||||
let format = endpoint.get_supported_formats_list().next().unwrap();
|
||||
let mut channel = cpal::Voice::new(&endpoint, &format).unwrap();
|
||||
|
||||
// Produce a sinusoid of maximum amplitude.
|
||||
let mut data_source = (0u64..).map(|t| t as f32 * 0.03)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue