gordonklaus / portaudio

Go bindings for the PortAudio audio I/O library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Invalid error returned for paNoDevice in DefaultInputDevice and DefaultOutputDevice

delthas opened this issue · comments

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.

Later when this error is printed it prints Invalid error code because paNoDevice is not a valid error code.

This error should not be wrapped under a portaudio.Error but probably instead just return some constant portaudio.errNoDevice.