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. New AudioEffect | processing pcm audio data

New AudioEffect | processing pcm audio data

Scheduled Pinned Locked Moved General and Desktop
12 Posts 5 Posters 5.9k 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.
  • L Offline
    L Offline
    lebeg
    wrote on last edited by
    #1

    Hi

    I am looking for a way to add a custom audio effect in the media pipeline either Phonon or QtMultimedia.

    What I want to do is read from different files (wav, mp3, ogg, etc) and get pcm data that I can process and give it to some output.

    I can't figure it out how to read plain data to a QIODevice - probably there will not be much problem to play audio from there...

    Does have anyone have an advice or ideas?

    Sincerely yours forever,
    lebeg

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tobias.hunger
      wrote on last edited by
      #2

      QIODevice::read and QIODevice::write spring to mind.

      1 Reply Last reply
      0
      • L Offline
        L Offline
        lebeg
        wrote on last edited by
        #3

        Yes, the question is exactly about what to write in those methods! :)

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andre
          wrote on last edited by
          #4

          [quote author="lebeg" date="1300177288"]Yes, the question is exactly about what to write in those methods! :) [/quote]

          Actually, it isn't. At least, those methods do you appear in your original question. Perhaps you should try to rephrase your question then, if it was really about QIODevice::read() and ::write()?

          1 Reply Last reply
          0
          • L Offline
            L Offline
            lebeg
            wrote on last edited by
            #5

            Ok, the question is not how to work with QIODevice - its about encoding audio pcm data. Is there a unified method to get pcm data INTO a QIODevice from any encoded file such as ogg or mp3?

            1 Reply Last reply
            0
            • A Offline
              A Offline
              andre
              wrote on last edited by
              #6

              You know what? Good question.

              I was digging through the Qt Phonon documentation a bit, and I could not find any reference on how to access the actual data stream. Even the documentation for the Effect class, which is what you are supposed to use if you want to manipulate the data, doesn't mention how to actually access that data. I fear you'll have to dig into the source code for Phonon/MediaNode and Phonon/Effect to find out more, or perhaps refer to the KDE documentation. That "documentation":http://api.kde.org/4.0-api/kdelibs-apidocs/phonon/html/phonon_backend_development_page.html, at least the section for backend developers, seems to tell you a bit more about the details of the involved classes. But I fear it will take digging into the sources to really find out how it works.

              1 Reply Last reply
              0
              • D Offline
                D Offline
                dangelog
                wrote on last edited by
                #7

                You can't access the raw data with phonon (at least the one in Qt), period. Investigate QtMultimedia.

                Software Engineer
                KDAB (UK) Ltd., a KDAB Group company

                1 Reply Last reply
                0
                • L Offline
                  L Offline
                  lebeg
                  wrote on last edited by
                  #8

                  Thank you for your fast answers!

                  I know that with Phonon it is not a simple story - writing additional backends, adding them to common API etc... But Phonon can be used for playback, since it can read data from an QIODevice.

                  QtMultimedia is much better to use and understand. Playback from an QIODevice can be done via QAudioOutput and all nice format classes such as QAudioFormat are present too. But there is still no chance to push pcm data to a QIODevice. A QMediaRecorder could do the encoding (probably?) but does not work with buffers either.

                  http://doc.qt.nokia.com/qtmobility-1.1.1/qmediarecorder.html

                  I have started to implement an custom loader with plugins and stuff but then i realized that the best way to do that would be submit code directly to Qt - that would avoid using a bunch off unnecessary intermediate interfaces and make a simple audio effect program look really simple. Where should i start to Qt contribution?

                  1 Reply Last reply
                  0
                  • A Offline
                    A Offline
                    andre
                    wrote on last edited by
                    #9

                    If you want to contribute code to Qt, you make your own branch of the Qt git repository at gitorious.org. That will allow you to do a merge request. Be prepared that, at least as long as the open governance is not in place, it can be a long and painful process. Perhaps best discuss your plans on IRC on #qt-labs first to see if there might be support for including your work at all, in order to prevent wasting loads of time.
                    Also relevant are the "coding guidelines":http://qt.gitorious.org/qt/pages/CodingConventions if you want to contribute to Qt. If your contribution doesn't match those, you can be sure it will be rejected.

                    1 Reply Last reply
                    0
                    • L Offline
                      L Offline
                      lebeg
                      wrote on last edited by
                      #10

                      Ok, thank you!

                      1 Reply Last reply
                      0
                      • M Offline
                        M Offline
                        michael.goddard
                        wrote on last edited by
                        #11

                        Here's a relevant JIRA task:
                        http://bugreports.qt.nokia.com/browse/QTMOBILITY-1132

                        Andre above has posted a lot of the details on making a merge request etc. You'll need to clone the mobility repo:

                        http://qt.gitorious.org/qt-mobility

                        since that's where QtMultimedia currently lives (modularization of Qt and QtMobility will change this, but that isn't ready at the moment)

                        1 Reply Last reply
                        0
                        • L Offline
                          L Offline
                          lebeg
                          wrote on last edited by
                          #12

                          That's great! Thanks! It start to sound very promising to me!

                          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