I need to determine the parameters of the audio file: bitrate, sampling rate, bit depth, audio format.
I have tried to use it like that:
#include <QtMultimedia/QMediaMetaData>
#include <QtMultimedia/QMediaObject>
#include "mainwindow.h"
#include "ui_mainwindow.h"
.
.
.
void MainWindow::on_pushButton_1_clicked()
{
QMediaObject mediafile;
QString file_name = "/run/media/helg/WDC/test.aac";
mediafile.setMedia(QUrl(file_name));
QString bitrate = mediafile.metaData(QMediaMetaData::AudioBitRate).toString();
.
.
.
}
.
.
.
But it doesn't work:
error: no matching constructor for initialization of
QMediaObject.
I'm not even sure if I should use a QMediaObject or something else.