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::setMedia first call faster than following calls

QMediaPlayer::setMedia first call faster than following calls

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
1 Posts 1 Posters 183 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
    smart_ptr
    wrote on last edited by
    #1

    Hi all,

    I'm using Qt 5.15 on an arm7 system. My code is implemented in C++ 17.

    I have a simple class containing a member of QMediaPlayer. The instance of my class and thus also the QMediaPlayer instance lives forever. My class has a method to play a given sound file. In my case, the sound file is a .wav file. The body of the method is quite simple, it just calls:

    m_mediaPlayer->setMedia(m_soundFileUrl);
    m_mediaPlayer->play();
    

    I have a simple UI with a button. And in onClicked I call the method to play a sound. For test purposes, it is currently (hard coded) always the same sound. I observed, that the first call of setMedia is significantly faster than following calls:

    duration of setMedia:  20.8233 ms
    c++Sound: 24ms
    
    duration of setMedia:  37.016 ms
    c++Sound: 39ms
    
    duration of setMedia:  37.4577 ms
    c++Sound: 41ms
    
    duration of setMedia:  35.025 ms
    c++Sound: 38ms
    

    My question now is, what is the reason for that?

    Regards,
    smart_ptr

    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