@@ -36,7 +36,7 @@ class AudioSourceModule : public ModuleManager::Instance {
3636 this ->name = name;
3737
3838#if RTAUDIO_VERSION_MAJOR >= 6
39- audio.setErrorCallback (&reportErrorsAsException );
39+ audio.setErrorCallback (&errorCallback );
4040#endif
4141
4242 sampleRate = 48000.0 ;
@@ -97,6 +97,9 @@ class AudioSourceModule : public ModuleManager::Instance {
9797 // Get info
9898 auto info = audio.getDeviceInfo (i);
9999
100+ #if !defined(RTAUDIO_VERSION_MAJOR) || RTAUDIO_VERSION_MAJOR < 6
101+ if (!info.probed ) { continue ; }
102+ #endif
100103 // Check that it has a stereo input
101104 if (info.inputChannels < 2 ) { continue ; }
102105
@@ -105,7 +108,7 @@ class AudioSourceModule : public ModuleManager::Instance {
105108 devices.define (info.name , info.name , dinfo);
106109 }
107110 catch (const std::exception& e) {
108- flog::error (" Error getting audio device info: id={0} : {1 }" , i, e.what ());
111+ flog::error (" Error getting audio device ({}) info : {}" , i, e.what ());
109112 }
110113 }
111114 }
@@ -263,14 +266,14 @@ class AudioSourceModule : public ModuleManager::Instance {
263266 }
264267
265268#if RTAUDIO_VERSION_MAJOR >= 6
266- static void reportErrorsAsException (RtAudioErrorType type, const std::string& errorText) {
269+ static void errorCallback (RtAudioErrorType type, const std::string& errorText) {
267270 switch (type) {
268271 case RtAudioErrorType::RTAUDIO_NO_ERROR:
269272 return ;
270273 case RtAudioErrorType::RTAUDIO_WARNING:
271274 case RtAudioErrorType::RTAUDIO_NO_DEVICES_FOUND:
272275 case RtAudioErrorType::RTAUDIO_DEVICE_DISCONNECT:
273- flog::warn (" AudioSource : {0 } ({1 })" , errorText, (int )type);
276+ flog::warn (" AudioSourceModule Warning : {} ({})" , errorText, (int )type);
274277 break ;
275278 default :
276279 throw std::runtime_error (errorText);
0 commit comments