Is there a callback to know when the device list is updated?
If not, is there a way of detecting it ( ideally cross platform )?
At the moment the only way i found is to re-initialise PortAudio.
ps: I tried to find "callbacks" documentation on PortAudio documentation but i failed to find it.
Not in the main line code. There is a branch supporting this functionality on some platforms. New contributors are always welcome to help out finish this. It is a much-needed feature.
Note that the device list is never updated between calls to
Pa_Initialize()
andPa_Terminate()
. This is a basic invariant of the API. The branch also supports arefresh
call.The way to do it with the current version is to use platform-specific checks, then call
Pa_Terminate();Pa_Initialize();
as you suggest.