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. QAudioInput example : bad values with unsigned integers
Forum Updated to NodeBB v4.3 + New Features

QAudioInput example : bad values with unsigned integers

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

    Hello.

    I am currently working with the Qt multimedia module and I am facing a strange behavior with the audio input example.

    When I set the audio format sample type to unsigned int, I get strange values with the sound level :

    • almost always "65535" with unsigned 16-bit integers
    • almost always "129" with unsigned 8-bit integers

    Everything is normal when I set audio format sample type to signed int.

    Does anyone faces the same issue ?

    Kind regards
    Aurélien

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

      Hi and welcome to devnet,

      You should add which version of Qt you are using as well as OS. Also, did you check that the format you are trying to use is supported by your sound card/driver ?

      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
      • P Offline
        P Offline
        passia
        wrote on last edited by
        #3

        Hi.

        Thank you for your reply.

        Of course I forgot the basis.
        I'm using Qt 5.4 for Windows 7.

        According to Qt the format I use is supported (QAudioDeviceInfo:: isFormatSupported returns true).

        By the way does it really change the bits I receive from my microphone ?

        Aurélien

        PS : I just realize I need 16 bit signed (not unsigned) PCM data for my 3rd party library, and I realize I spent hours for nothing :-)

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

          Your microphone will send the same noise, it's how it's represented that will change however, you don't always get what you request on windows.

          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