phonon seek does not work as i want?
hello every body.
i am using phonon to play sound file but i want the sound file to start from a specified position so i used the following code
m_player = Phonon::createPlayer(Phonon::MusicCategory, Phonon::MediaSource(aSoundFile));
m_player->play();
m_player-seek();
but it does not work it starts from the beginning of the file
how can i play the sound file from the specified position?
Re: phonon seek does not work as i want?
Hello,
I see that a mediaobject can emit a signal MediaObject::seekableChanged ( bool isSeekable ) when the state of the seeking property has changed.
Maybe you could try to wait for this signal before using the seek() method, or use isSeekable() to check the state before seeking.
bye
Re: phonon seek does not work as i want?
Quote:
Originally Posted by
yvan
Hello,
I see that a mediaobject can emit a signal MediaObject::seekableChanged ( bool isSeekable ) when the state of the seeking property has changed.
Maybe you could try to wait for this signal before using the seek() method, or use isSeekable() to check the state before seeking.
bye
Hello I am trying the same thing as mismael85. I have tried what yvan sad, but with no luck.
In QT doc is stated: You can only seek if state() is PlayingState, BufferingState or PausedState.
So I tested the state() of my mediaObject, and when is in PlayingState, the isSeekable() method returns false, and my program never enters in my SLOT connected to the signal seekableChanged!
What am I doing wrong, here?
Re: phonon seek does not work as i want?
Quote:
Originally Posted by
mismael85
m_player = Phonon::createPlayer(Phonon::MusicCategory, Phonon::MediaSource(aSoundFile));
m_player->play();
m_player-seek();
Hi, try this:
m_player->seek(0);
m_player->play();