rust-portaudio
rust-portaudio copied to clipboard
Panic if no default input device is found
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.
Confirmed that the same happens for default_output_device when running any of the examples on Ubuntu 16.10.