Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Multimedia
  4. No supported format in QAudioFormat
Qt 6.11 is out! See what's new in the release blog

No supported format in QAudioFormat

Scheduled Pinned Locked Moved Solved Qt Multimedia
2 Posts 1 Posters 525 Views
  • 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.
  • DanekoD Offline
    DanekoD Offline
    Daneko
    wrote on last edited by
    #1

    Just a simple example:

    #include <QCoreApplication>
    #include <QAudioSink>
    #include <QMediaDevices>
    #include <QDebug>
    int main(int argc, char *argv[])
    {
        QCoreApplication a(argc, argv);
    
        QAudioFormat format = QMediaDevices::defaultAudioOutput().preferredFormat();
        if (!QMediaDevices::defaultAudioOutput().isFormatSupported(format)) {
            qWarning() << "Format not supported!";
        }
        return a.exec();
    }
    
    

    And I get the output:
    "Format not supported!"

    How is this possible? I'm on Windows 11, Qt 6.8.2, Qt Creator 15.0.1 (Enterprise).
    I checked that QMediaDevices::defaultAudioOutput() outputs my device (I listen to music from it in the browser, everything works).
    Maybe I somehow misunderstand how QAudioFormat works. But I tried a little bit to manually specify QAudioFormat properties, and it still showed that the format are not supported.

    1 Reply Last reply
    0
    • DanekoD Offline
      DanekoD Offline
      Daneko
      wrote on last edited by
      #2

      I updated to Qt 6.9.0 and Qt Creator 16.0.1 and problem disappeared!

      1 Reply Last reply
      0
      • SGaistS SGaist has marked this topic as solved on
      • Nhan NguyenN Nhan Nguyen moved this topic from General and Desktop on

      • Login

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