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. Playing the raw file created by QAudioInput using windows media player? ["SOLVED"]
QtWS25 Last Chance

Playing the raw file created by QAudioInput using windows media player? ["SOLVED"]

Scheduled Pinned Locked Moved General and Desktop
7 Posts 2 Posters 3.0k 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.
  • J Offline
    J Offline
    jeevan_reddy
    wrote on last edited by
    #1

    How do we play the file with ".raw" extension created when microphone audio is recorded by QAudioInput, using the windows media player? Basically what are the steps to convert the raw file to a format compatible to windows media player?

    1 Reply Last reply
    0
    • JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by
      #2

      Hi,

      You can use a 3rd-party library like libsndfile to do the conversion. Google can show you other ways: http://www.google.com/search?q=convert+raw+to+wav

      Alternatively, you can use "QAudioRecorder":http://qt-project.org/doc/qt-5/qaudiorecorder.html to record directly into a .wav file, so you don't need to do any conversions.

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jeevan_reddy
        wrote on last edited by
        #3

        @JKSH- Thank you very much for the reply. I am currently using Qt4.8.5 which doesn't have QAudioRecorder. I'll switch to Qt 5.0 and above, so that it makes my life easy :-)

        1 Reply Last reply
        0
        • JKSHJ Offline
          JKSHJ Offline
          JKSH
          Moderators
          wrote on last edited by
          #4

          You're welcome :)

          If you want to switch to Qt 5, this guide will help you: http://qt-project.org/doc/qt-5/portingguide.html

          I recommend Qt 5.2 -- it has many improvements over Qt 5.0.

          All the best with your project!

          Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

          1 Reply Last reply
          0
          • J Offline
            J Offline
            jeevan_reddy
            wrote on last edited by
            #5

            @JKSH - I am not switching to Qt 5.0 due to some constraints currently. However my goal finally is not to create a wav file but I just wanted to play the file using my windows media player. I currently managed to play the raw file but found out that my raw file contains only noise. It is not recording any audio from microphone.

            Could you please look at my other post on microphone issue and let me know whats the problem in my code?

            Regards,
            Jeevan

            1 Reply Last reply
            0
            • JKSHJ Offline
              JKSHJ Offline
              JKSH
              Moderators
              wrote on last edited by
              #6

              [quote author="jeevan_reddy" date="1391072733"]I just wanted to play the file using my windows media player. I currently managed to play the raw file but found out that my raw file contains only noise. It is not recording any audio from microphone.[/quote]It doesn't "contain noise". It contains raw PCM data.

              However, like I explained in your "other thread":http://qt-project.org/forums/viewthread/37736/, your raw file does not contain information about the audio format, so Windows Media Player cannot understand it.

              Windows Media Player doesn't know whether your file contains 8-bit or 16-bit audio. It doesn't know if your data represents integers or floats. It doesn't know if you have 1 channel or 2 channels. (and there are lots of other things it doesn't know)

              When Windows Media Player tried to guess the format, it guessed wrongly so your audio came out as noise.

              You can use Audacity to play raw PCM files, and save it in a format that Windows Media Player can understand. See my reply your other thread.

              Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

              1 Reply Last reply
              0
              • J Offline
                J Offline
                jeevan_reddy
                wrote on last edited by
                #7

                @JKSH - I haven't used windows media player to play raw file. My colleague copied the wave header content to the raw file and converted it to wav file. I believe there is genuimely problem with the content in my file. I feel QAudioInput is fails to read the audio content from my desktop's microphone.

                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