Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QMediaPlayer - function setPlaybackRate(qreal r)

QMediaPlayer - function setPlaybackRate(qreal r)

Scheduled Pinned Locked Moved Mobile and Embedded
qmediaplayersetplaybackrate
7 Posts 3 Posters 2.8k 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.
  • K Offline
    K Offline
    kralpavel
    wrote on 5 Jul 2016, 09:15 last edited by kralpavel 7 May 2016, 09:17
    #1

    QMediaPlayer - function setPlaybackRate(qreal r) not working on linux and android .play with standart rate 1.0 no bug nothing.but change rate not work .any idea?.in doc nothing about that this function not suported on android/linux..but function work correctly just on win ..on linux also problem app just freeze.also no bugs nothing ..thanks so much for help

    music2 = new QMediaPlayer(this);
    qreal rate = 0.50;
    music2->setPlaybackRate(rate);
    music2->setMedia(QUrl("qrc:/samples/clap.wav"));
    music2->play();

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mvuori
      wrote on 5 Jul 2016, 10:07 last edited by
      #2

      Just a note:

      Somebody might know about this particular function, but unfortunately it seems to be very common that functions don't work on "secondary platforms" and the documentation says nothing about it. So, don't be surprised if this turns out to be state of things.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 5 Jul 2016, 22:34 last edited by
        #3

        Hi,

        A quick look at the backend code shows that on Android this function indeed doesn't do anything while on Linux, using GStreamer the media needs to be "seekable".

        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
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 5 Jul 2016, 22:41 last edited by
          #4

          Speaking of "seekable". I'd move the setPlaybackRate call after setting the media.

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

          K 1 Reply Last reply 6 Jul 2016, 07:08
          0
          • S SGaist
            5 Jul 2016, 22:41

            Speaking of "seekable". I'd move the setPlaybackRate call after setting the media.

            K Offline
            K Offline
            kralpavel
            wrote on 6 Jul 2016, 07:08 last edited by
            #5

            @SGaist
            Thank you very much Samuel for reply.
            I know how it works on linux qt use gstreamer => use pulse audio => use ALSA for communication with kernel.I also reed the doc about backends .there is nothing that this function will not work on android/linux .I also tried put function before after .move from constructor as single function .the same result just freeze..and on android play but with rate 1.0..I am just disapointed because I have not warnings errors nothing:( and not work:( also I am sorry that I put this more times but it was just mistake..And I cant delete it now topic is locked...so any idea what to do next?use other audio lib?have you experience with other audio lib and can give me some tips?
            last one thank you for reply .Pavel

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 6 Jul 2016, 08:02 last edited by
              #6

              I saw several people using SFML. So it might be an alternative depending on your needs.

              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
              • K Offline
                K Offline
                kralpavel
                wrote on 6 Jul 2016, 10:49 last edited by
                #7

                Thank you for tip..I will check it..

                1 Reply Last reply
                0

                4/7

                5 Jul 2016, 22:41

                • Login

                • Login or register to search.
                4 out of 7
                • First post
                  4/7
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved