rust-portaudio icon indicating copy to clipboard operation
rust-portaudio copied to clipboard

Panic if no default input device is found

Open Bun opened this issue 9 years ago • 1 comments

The function default_input_device causes a panic when no input device is found. The function Pa_GetDefaultInputDevice returns -1 (paNoDevice), which it then attempts to convert to an Error, which panics at the unwrap.

The same issue likely exists for default_output_device as well.

A fix would be to include -1 explicitly in Error, or to handle the -1 value.

Bun avatar Aug 05 '16 21:08 Bun

Confirmed that the same happens for default_output_device when running any of the examples on Ubuntu 16.10.

EddyLuten avatar Feb 14 '17 06:02 EddyLuten