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. Get audio device supported sample rates in Qt6
Forum Updated to NodeBB v4.3 + New Features

Get audio device supported sample rates in Qt6

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 637 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.
  • M Offline
    M Offline
    mnbv
    wrote on last edited by
    #1

    How can I get a list of supported sample rates for a given QAudioSource in Qt6 (6.4.1)?

    Qt5 has QAudioInput::supportedSampleRates(), but I can't seem to find an equivalent for the QAudioSource in 6.

    Thanks!

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      I think it can be retrieved via QAudioDevice

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      M 1 Reply Last reply
      0
      • Christian EhrlicherC Christian Ehrlicher

        I think it can be retrieved via QAudioDevice

        M Offline
        M Offline
        mnbv
        wrote on last edited by
        #3

        @Christian-Ehrlicher Ah thanks. I found it, they changed the API from a list of sample rates to minimumSampleRate() and maximumSampleRate().

        Do you know if there's a way to get a list of the sample rates the device natively supports?

        It looks like they made a move to support arbitrary sample rates, resampling as needed, which is fancy I guess, but for quality and performance (and also UI) it'd be nice to know what the native rates are that don't get munged by the resampler.

        Also it seems like the min/max might not be correct. I know for example that one of my devices natively supports 8kHz, and Qt5 also reported that in the list, but Qt6 reports 11.25kHz as the minimum sample rate.

        1 Reply Last reply
        0
        • Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Sorry I don't have muich knowledge about QMultimedia. Maybe step in to the Qt sources to see why a wrong sample rate is returned and then open a bug report about it.

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          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