Important: Please read the Qt Code of Conduct -

QAudioDeviceInfo::availableDevices always returning devices even when no microphone is attached.

  • Hello ,
    I am trying to enumerate audio devices on the system (Windows7 Qt4.8 msvc2010) and the call to

    QAudioDeviceInfo::availableDevices ( QAudio::AudioInput );

    always returns a list with a few devices even when I have no device( attached to the PC.
    It is returning

    Microphone /Line In(Sigmatel)  and 

    on one of my test boxes.I suspect that it is a problem with the system set up on my particular machine as I tested on a machine(Desktop) at my workplace by chance and it returns 0 when there is no microphone attached.

    This problem doesn't only affect QAudioDeviceInfo ,it also affects my openCV module to detect the attached web cams.(I know this is another topic but I suspect that the two problems are related).

    Any hints on how I can get QAudioDeviceInfo::availableDevices to return 0 when no mic is attached ?

    Thank you for your time.

  • Lifetime Qt Champion


    That's rather a Windows problem. Qt queries Windows to get the list of devices so it's your system that's returning something fishy