Hi to all,
I have some problem using the Phonon module. I would use it to play an audio file.
This is the code I used.
In my *.h file:
Phonon::AudioOutput *audioOutput;
Phonon::MediaObject *mediaObject;
Phonon::AudioOutput *audioOutput;
Phonon::MediaObject *mediaObject;
To copy to clipboard, switch view to plain text mode
Then in my *.cpp file:
audioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this);
mediaObject = new Phonon::MediaObject(this);
Phonon::Path path = Phonon::createPath(mediaObject, audioOutput);
mediaObject->setCurrentSource(Phonon::MediaSource(":/sounds/file.wav"));
mediaObject->play();
audioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this);
mediaObject = new Phonon::MediaObject(this);
Phonon::Path path = Phonon::createPath(mediaObject, audioOutput);
mediaObject->setCurrentSource(Phonon::MediaSource(":/sounds/file.wav"));
mediaObject->play();
To copy to clipboard, switch view to plain text mode
When I execute the code I don't listen nothing. Instead if I try to play the file with the phonon demo there is no problem.
Which can be the problem?
Regards
Bookmarks