Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    QAudioInput example : bad values with unsigned integers

    General and Desktop
    2
    4
    644
    Loading More Posts
    • 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
      passia last edited by

      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 Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        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 Reply Quote 0
        • P
          passia last edited by

          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 Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            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 Reply Quote 0
            • First post
              Last post