I solved adding in the .pro file the row:
now that it works,
QT += core gui phonon
i added the remaining part of the code in file mainWindow.cpp:
and in sub on_pushButton_clicked() i added:
then i copied the file Scream.wav in the external memory (e: )
pAudioOutput = new Phonon::AudioOutput( Phonon::MusicCategory, this);
Phonon::MediaObject* pMediaObject ;
pMediaObject = new Phonon::MediaObject(this);
QString url= QString("e:\\Scream.wav");
Phonon::MediaSource mediaSource = Phonon::MediaSource(url);
pMediaObject ->setCurrentSource( mediaSource);
I verified that i can listen to this file on the default player of the phone.
And when i run the code, and press the button, the phone plays the wav.
Now: How can i change the output device, choosing from available outputs? (for example in case i have 2 bluetooth headphone connected, and i want to stream a file only to one of these headphone).
I’ll study on this question.