[Qt-interest] Phonon with audio CD

Dan Miron dan.miron at gmx.com
Tue Jan 11 16:42:11 CET 2011


Hello guys,
I would like to make a player for audio cds and I'm not whether I'm 
dealing with a Phonon bug or I'm doing something wrong:

1    mediaObject = new Phonon::MediaObject(NULL);
2    audioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, NULL);
3    mediaObject->setTickInterval(1000);
4    path = Phonon::createPath(mediaObject, audioOutput);

5    // just a workaround, otherwise won't load the cd
6    
mediaObject->setCurrentSource(Phonon::MediaSource("/home/dan/Music/THE_BEATLES-Help.mp3"));

7    Phonon::MediaSource* source = new Phonon::MediaSource(Phonon::Cd);
8    mediaObject->setCurrentSource(*source);

9    mediaObject->play();

So, if I remove the 6th line, the cd playback won't start.


A second question: if I want to start playback with a specific track, 
shouldn't

mediaObject->setCurrentSource(QUrl("cdda://4"));

work? Well, it doesn't. No matter what, it starts playing the first track.

Thanks.



More information about the Qt-interest-old mailing list