When there are no input devices or output devices on the system, DefaultInputDevice (DefaultOutputDevice) calls C.Pa_GetDefaultInputDevice (C.Pa_GetDefaultInputDevice) which returns paNoDevice.
paNoDevice is < 0 so the wrappers return newError(C.PaError(i)); however paNoDevice is not a PaError. It's just a special number returned when there's no device.
When there are no input devices or output devices on the system,
DefaultInputDevice
(DefaultOutputDevice
) callsC.Pa_GetDefaultInputDevice
(C.Pa_GetDefaultInputDevice
) which returnspaNoDevice
.paNoDevice
is< 0
so the wrappers returnnewError(C.PaError(i))
; howeverpaNoDevice
is not aPaError
. It's just a special number returned when there's no device.Later when this error is printed it prints
Invalid error code
becausepaNoDevice
is not a valid error code.This error should not be wrapped under a
portaudio.Error
but probably instead just return some constantportaudio.errNoDevice
.