Important: Please read the Qt Code of Conduct -

What is the fastest way to start playing audio in QT application?

  • I am developing an application in which i have a timeline which represents a song and I can put some effects to it. By moving the effect the song should start playing from specific time. I tried to use QMediaPlayer and that would be fine but when I move the effect, playback doesnt start immediately and that is the problem. There is just a very little delay but it is a problem in this case. I tried to look for the answers and I found some topics about low latency audio. I tried to implement Portaudio but I am pretty lost using it and even when I dont know if that would help.

    Can somebody please give me some advice what should I use or what should I focus on?

    Thank you.

  • Lifetime Qt Champion


    IIRC, PortAudio is a good bet for what you have in mind. QMediaPlayer as it names suggests is for playing media, not doing audio mixing.

    IIRC, I did at some point implement a QIODevice for PortAudio but that was a long time ago.

  • Ok maybe I was not exact. I do not want to mix the audio. The effect has nothing to do with audio it should just be synchronised with the music because is some kind of visual effect that you can move and the music gets played from the point where you move the effect and that should be immediate. And I found that portaudio is not for formatted audio files such as wav for example.

  • Lifetime Qt Champion

    So it's somehow getting the audio and video track in sync like in a movie, correct ?

Log in to reply