Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Phonon::mediaObject - searching for a possibility to get the audio length

Phonon::mediaObject - searching for a possibility to get the audio length

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
mediaobject
3 Posts 2 Posters 633 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.
  • S Offline
    S Offline
    serendipity2
    wrote on last edited by
    #1

    I am hardly searching for a solution of getting the audio length for my MediaObject in C++.

    I tried: long len = Phonon::mediaObject->totalTime();
    It gives me always the value -1 (Ideas to handle it? I put it after the play-button so it should be in the "LoadingState".

    I also tried totalTimeChanged it gives me the error: no matching function for call to 'Phonon::MediaObject::totalTimeChanged()'

    Do you have any ideas or better solutions to get the audio file length?

    jsulmJ 2 Replies Last reply
    0
    • S serendipity2

      I am hardly searching for a solution of getting the audio length for my MediaObject in C++.

      I tried: long len = Phonon::mediaObject->totalTime();
      It gives me always the value -1 (Ideas to handle it? I put it after the play-button so it should be in the "LoadingState".

      I also tried totalTimeChanged it gives me the error: no matching function for call to 'Phonon::MediaObject::totalTimeChanged()'

      Do you have any ideas or better solutions to get the audio file length?

      jsulmJ Online
      jsulmJ Online
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @serendipity2 said in Phonon::mediaObject - searching for a possibility to get the audio length:

      totalTimeChanged

      this is a signal, you don't call it like a function, instead you connect a slot to it.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • S serendipity2

        I am hardly searching for a solution of getting the audio length for my MediaObject in C++.

        I tried: long len = Phonon::mediaObject->totalTime();
        It gives me always the value -1 (Ideas to handle it? I put it after the play-button so it should be in the "LoadingState".

        I also tried totalTimeChanged it gives me the error: no matching function for call to 'Phonon::MediaObject::totalTimeChanged()'

        Do you have any ideas or better solutions to get the audio file length?

        jsulmJ Online
        jsulmJ Online
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #3

        @serendipity2 Also it has a parameter: void totalTimeChanged (qint64 newTotalTime)

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        1

        • Login

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