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. QAudioOutput
Qt 6.11 is out! See what's new in the release blog

QAudioOutput

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 385 Views 2 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.
  • S Offline
    S Offline
    satyanarayana143
    wrote on last edited by satyanarayana143
    #1

    i am using qt 5.15 mingw

    QAudioFormat format;
    format.setChannelCount(1);
    format.setSampleRate(8000);
    format.setSampleSize(16);
    format.setCodec("audio/pcm");
    format.setByteOrder(QAudioFormat::LittleEndian);
    format.setSampleType(QAudioFormat::SignedInt);

    foreach (const QAudioDeviceInfo &deviceInfo, QAudioDeviceInfo::availableDevices(QAudio::AudioOutput))
    {
        qDebug() << " Device name: " << deviceInfo.deviceName();
    }
    
    QAudioDeviceInfo info(QAudioDeviceInfo::defaultOutputDevice());
     qDebug() << " Device name22: " << info.deviceName();
    

    QAudioOutput *speaker = new QAudioOutput(QAudioDeviceInfo::defaultOutputDevice(),format);

    speaker iam getting null.

    i am running this code in windows

    QAudioDeviceInfo::defaultOutputDevice() name i am getting empty when i print deviceInfo.deviceName();
    i am getting windows speakers device

    what is the issue

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      You might be requesting a format that is not supported by the default output of your system.

      Check your device and what they currently supported.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      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