Please nominate your Qt Champions for 2021!

Music visualization

  • Hello!

    There is a player that plays mp3-files using QMediaPlayer. I want to implement visualization of the played track. The documentation found that access to the audio buffer during playback can be obtained using the QAudioProbe class. I do it this way:

    Probe = new QAudioProbe ();
    Probe-> setSource (player); // player - QMediaPlayer object
    Connect (probe, SIGNAL (audioBufferProbed (QAudioBuffer)), this, SLOT (processBuffer (QAudioBuffer)));

    Then in the slot processBuffer we have access to the buffer:
    Void MainWindow :: processBuffer (const QAudioBuffer & buffer)

    How does this buffer work? How to get parameters that can be visualized (amplitude, frequency)?

  • Hi @ar3em
    There is a nice example in Qt Multimedia about this:
    That should have all the necessary pieces in it.

    Also the basic documentation has a snippet on the topic

Log in to reply