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. QAudioProbe::audioBufferProbed() behavior

QAudioProbe::audioBufferProbed() behavior

Scheduled Pinned Locked Moved Unsolved General and Desktop
11 Posts 2 Posters 3.2k 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.
  • yodlY Offline
    yodlY Offline
    yodl
    wrote on last edited by
    #1

    I have a QMediaPlayer which I set as source for a QAudioProbe. Then I connect the signal audioBufferProbed() to a private slot in my class like this:

    connect(m_probe, SIGNAL(audioBufferProbed(const QAudioBuffer&)), this, SLOT(processAudioProbe(const QAudioBuffer&)));
    

    Here's what I don't understand: I have a button for opening an audio file and one for playing it. As soon as I open the file, audioBufferProbed() is emmitted, even before I even clicked play. What data do I get here? Why is the buffer probed before the player even plays?

    Here's the open function:

    void MainWidget::openFile(const QString &fileName)
    {
        QUrl url = QUrl::fromLocalFile(fileName);
        QMediaContent media(url);
        m_player->setMedia(media); // this already seems to trigger audioBufferProbed()
    }
    

    Here's play:

    void MainWidget::startPlayback()
    {
        m_player->play();
    }
    
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Does it happen also when you open a file the first time ? Or only after you already opened one and replace it with another ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      yodlY 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi and welcome to devnet,

        Does it happen also when you open a file the first time ? Or only after you already opened one and replace it with another ?

        yodlY Offline
        yodlY Offline
        yodl
        wrote on last edited by yodl
        #3

        Hi,

        It happens also the first time I open a file.

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

          What version of Qt and OS are you using ?

          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
          • yodlY Offline
            yodlY Offline
            yodl
            wrote on last edited by yodl
            #5

            I'm on Ubuntu 14.04 using Qt 5.5.1 64 bit.

            1 Reply Last reply
            0
            • yodlY Offline
              yodlY Offline
              yodl
              wrote on last edited by
              #6

              I created a minimal working example which demonstrates the issue: https://bitbucket.org/rdssdf/mweaudioprobe

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

                Since you're on Linux, It might be something that's GStreamer specific.

                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
                • yodlY Offline
                  yodlY Offline
                  yodl
                  wrote on last edited by
                  #8

                  Ok, I just confirmed that the issue does not occur on Windows. You are probably right that it is GStreamer specific. So... what are my options on Linux? Can I configure GStreamer somehow or can I run Qt with a different audio framework? I'd really like to build my app for Linux as well.

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

                    Depending on your Qt version you could rebuild the multimedia module using GStreamer 1.0

                    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
                    • yodlY Offline
                      yodlY Offline
                      yodl
                      wrote on last edited by
                      #10

                      I rebuilt Qt 5.5 from source with GStreamer 1.0 but it's still the same. Btw, is there a way to rebuild a module and pass configure options using the web installer? I had to checkout the sources from git and compile them because I could not find out how to do it.

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

                        You can get the sources from the installer but not start a build from there.

                        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