Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
ar3em last edited by
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)?
tekojo last edited by
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 http://doc.qt.io/qt-5/audiooverview.html