Results 1 to 4 of 4

Thread: phonon seek does not work as i want?

  1. #1
    Join Date
    Feb 2008
    Posts
    154
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Windows

    Question 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?

  2. #2
    Join Date
    Jan 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default 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

  3. #3
    Join Date
    Feb 2011
    Posts
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: phonon seek does not work as i want?

    Quote Originally Posted by yvan View Post
    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?

  4. #4
    Join Date
    Jan 2011
    Location
    Verona(Italy)
    Posts
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: phonon seek does not work as i want?

    Quote Originally Posted by mismael85 View Post
    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();

Similar Threads

  1. I cannot run the phonon demos in the PXA270!Can someone help me?
    By Justin_W in forum Qt for Embedded and Mobile
    Replies: 8
    Last Post: 19th February 2010, 10:14
  2. Replies: 2
    Last Post: 13th December 2009, 20:27
  3. phonon does't work fine in debian/kubuntu/ubuntu
    By skhaz in forum Qt Programming
    Replies: 2
    Last Post: 9th February 2009, 13:01
  4. phonon VideoPlayer seek
    By rbp in forum Qt Programming
    Replies: 4
    Last Post: 31st October 2008, 04:53
  5. QSqlQuery and seek() - doesn't work on first call.
    By amicitas in forum Qt Programming
    Replies: 1
    Last Post: 2nd October 2008, 17:25

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.