Unable to play audio (.mid) files

55 Views Asked by At

I need the program to play audio .mid files.

I'm using code from Audio Overview from the Qt Documentation:

QMediaPlayer *player = new QMediaPlayer;
QAudioOutput *audioOutput = new QAudioOutput;

audioOutput->setDevice(QMediaDevices::defaultAudioOutput()); //Speaker(Realtek(R))Audio

player->setAudioOutput(audioOutput);
player->setSource(QUrl::fromLocalFile("small_test.mid"));
player->play(); 

I don't hear any sound when I launch the program, also, after initializating *player, the terminal shows me the following:

Available HW decoding frameworks:
     d3d11va
     dxva2
Available HW encoding frameworks:
     d3d11va
     dxva2

I compiled the code on Windows. Maybe it is supposed to use another approach for midi files?

0

There are 0 best solutions below