[Interest] Refreshing Audio Device List

Randy Yates yates at digitalsignallabs.com
Thu May 29 04:57:43 CEST 2014


Hi Thiago,  yates here, from #qt. How are you?   I'm maintaining a 
combobox with a list of the audio devices obtained from 
QAudioDeviceInfo::availableDevices() and i'd like to refresh the list with a refresh button. However, re-executing  
 
  audioDeviceList = 
  QAudioDeviceInfo::availableDevices(QAudio::AudioInput); 
 
within the same runningn application doesn't update the device list.

If I exit the app and restart, it shows me the new device list (I'm hot-plugging a USB audio device in and out).

How do I get a refreshed availableDevices()?

Note that I found an almost identical bug reported here:

https://bugreports.qt-project.org/browse/QTBUG-16842?page=com.atlassian.jira.plugin.system.issuetabpanels:changehistory-tabpanel

However, that reporter said the problem went away when using
QApplication instead of QCoreApplication, and I am already using
QApplication:

#include "cvrgui.h" include "cvrguiwindow.h" include 
#<QApplication>  int main(int argc, char* argv[]) { 
  Q_INIT_RESOURCE(cvrgui); QApplication app(argc, argv); 
  app.setApplicationName("Continuous Voice Recognition GUI"); 
  app.setOrganizationName("Digital Signal Labs"); 
 
  CvrGuiWindow cvrGui; cvrGui.show(); 
 
  return app.exec(); 
} 
 
Any help would be appreciated.
-- 
Randy Yates
Digital Signal Labs
http://www.digitalsignallabs.com



More information about the Interest mailing list