Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QAudioDeviceInfo - no formats available
Forum Updated to NodeBB v4.3 + New Features

QAudioDeviceInfo - no formats available

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    ilyasivkov
    wrote on last edited by
    #1

    Hi,

    I wrote a simple test code
    @ QList<QAudioDeviceInfo> devices = QAudioDeviceInfo::availableDevices(QAudio::AudioInput);

    foreach(QAudioDeviceInfo deviceInfo, devices)
    {
        printf("Name: %s\n", deviceInfo.deviceName().toLatin1().constData());
    
        printList(deviceInfo.supportedByteOrders(),  "Orders: ");
        printList(deviceInfo.supportedChannelCounts(),"Channs: ");
        printList(deviceInfo.supportedCodecs(),      "Codecs: ");
        printList(deviceInfo.supportedSampleRates(), "Rates : ");
        printList(deviceInfo.supportedSampleSizes(), "Sizes : ");
        printList(deviceInfo.supportedSampleTypes(), "Types : ");
    }
    

    @

    Being run on my PC (WinXP SP3), it prints valid information (two devices, about 20 formats per each). But on my friend's PC (Windows 7) it prints one device (Logitech webcam) and NO formats for it!

    It's interesting that on friend's PC webcam's name starts with zero character. If we see Qt's sources, we can read
    @void QAudioDeviceInfoInternal::updateLists()
    {
    ....
    WAVEINCAPS woc;
    unsigned long iNumDevs,i;
    iNumDevs = waveInGetNumDevs();
    for(i=0;i<iNumDevs;i++) {
    if(waveInGetDevCaps(i, &woc, sizeof(WAVEINCAPS))
    == MMSYSERR_NOERROR) {
    tmp = QString((const QChar *)woc.szPname);
    if(tmp.compare(device) == 0) { // <---
    match = true;
    fmt = woc.dwFormats;
    break;
    }
    if(base) {
    match = true;
    fmt = woc.dwFormats;
    break;
    }
    }
    }@

    I surmise, the string comparsion fails here.

    How to avoid it???

    Thanks for all!

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved