Only allow for private construction of SupportedStreamConfig.
This should give the user a higher confidence that, if they have a `SupportedStreamConfig` format type that it is actually supported. Also updates the `raw` stream builder methods to take a `StreamConfig` and `SampleFormat` as separate arguments for flexibility. **Backends Updated** - [x] null - [x] alsa - [ ] emscripten - [ ] coreaudio - [ ] wasapi - [ ] asio
This commit is contained in:
parent
07b66f52f3
commit
476f6c4c2c
8 changed files with 92 additions and 58 deletions
|
|
@ -22,8 +22,8 @@ fn main() -> Result<(), anyhow::Error> {
|
|||
println!(" {}. \"{}\"", device_index + 1, device.name()?);
|
||||
|
||||
// Input configs
|
||||
if let Ok(fmt) = device.default_input_config() {
|
||||
println!(" Default input stream config:\n {:?}", fmt);
|
||||
if let Ok(conf) = device.default_input_config() {
|
||||
println!(" Default input stream config:\n {:?}", conf);
|
||||
}
|
||||
let mut input_configs = match device.supported_input_configs() {
|
||||
Ok(f) => f.peekable(),
|
||||
|
|
@ -45,8 +45,8 @@ fn main() -> Result<(), anyhow::Error> {
|
|||
}
|
||||
|
||||
// Output configs
|
||||
if let Ok(fmt) = device.default_output_config() {
|
||||
println!(" Default output stream config:\n {:?}", fmt);
|
||||
if let Ok(conf) = device.default_output_config() {
|
||||
println!(" Default output stream config:\n {:?}", conf);
|
||||
}
|
||||
let mut output_configs = match device.supported_output_configs() {
|
||||
Ok(f) => f.peekable(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue