Hi,
I am trying to build a simple Phonon application. I have tried a simple code like:
QList<AudioOutputDevice> ss=Phonon::BackendCapabilities::availableAudioOutputDevices();
MediaObject *m_media;
m_media = new Phonon::MediaObject(this);
Phonon::AudioOutput *audioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this);
//audioOutput->setOutputDevice(Phonon::AudioOutputDevice::fromIndex((((AudioOutputDevice)ss.at(0)).index())));
createPath(m_media, audioOutput);
MediaSource m=MediaSource("/FileSpace/n.mp3");
m_media->setCurrentSource(m);
m_media->play();
QApplication::setApplicationName("panda");
QList<AudioOutputDevice> ss=Phonon::BackendCapabilities::availableAudioOutputDevices();
MediaObject *m_media;
m_media = new Phonon::MediaObject(this);
Phonon::AudioOutput *audioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this);
//audioOutput->setOutputDevice(Phonon::AudioOutputDevice::fromIndex((((AudioOutputDevice)ss.at(0)).index())));
createPath(m_media, audioOutput);
MediaSource m=MediaSource("/FileSpace/n.mp3");
m_media->setCurrentSource(m);
m_media->play();
To copy to clipboard, switch view to plain text mode
This code compiled and ran w/o any error, however I do not get any output.
I have also tried Media Player example in Qt site, in that, when I push play button immediately playing ends.
Any thoughts or comments?
Bookmarks