cpal icon indicating copy to clipboard operation
cpal copied to clipboard

How to handle zero channels in `SupportedStreamConfig`?

Open maxded opened this issue 3 years ago • 1 comments

Recently I noticed it is possible for cpal to create a valid audio device through HostTrait::default_output_device even though the SupportedStreamConfig returned from DeviceTrait::default_output_config had a channel count of 0. Is this expected behavior? If so, what does a channel count of 0 mean?

I'm aware that a device may become invalid if they get disconnected. That is not the case in my example, this all happens during initialization code.

If any more info is required let me know!

maxded avatar Jun 21 '22 12:06 maxded

Not an answer, but maybe related: https://github.com/RustAudio/cpal/pull/553 suggests to use "zero channels" to abstract over input/output/duplex.

kawogi avatar Sep 20 '22 20:09 kawogi