Results 1 to 2 of 2

Thread: Phonon endless stream - any phonon expert out there?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2011
    Posts
    12
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Phonon endless stream - any phonon expert out there?

    Hi,
    I am trying to play an endless HTTP mp3 stream using phonon. Its working well, except for one thing, which I will proceed to explain.

    The way I'm doing this is using a QNetworkReply (QIODevice subclass) to store the downloaded data. When I have enough data available, I feed it to the Phonon::MediaObject with setCurrentSource() and start playing. This works in general, but it depends on how much data is available when I start playing:

    - If there is around 50-60Kb stored, the MediaObject will read it all at once, play it and stop. Even if the QNetworkReply continues to receive data, it will not continue playing after it has played the initial 50-60kb.
    - If there is more data (usually 90Kb-100Kb is enough) it will read just 50-60kb with the first big read, then it will continue reading & playing while the stream is downloaded.

    So, it seems that the MediaObject has quite a large buffer which it needs to fill - when full, if there is data remaining to be read, it will read & play forever. If it can fill the buffer with just 1 read, it doesnt check again if there is more data at the source.

    The problem with all this is that the stream is 64kbps, so 100Kb takes a long time to fill. It is too much delay when starting to play, or when changing to a new channel. Plus the fact that I don't like that such things are not under control in my program...

    I haven't found any way to control the size of this buffer, so does anyone know how I could do this, or what can be done to solve this problem?

    Thanks in advance,

    Derek

  2. #2
    Join Date
    Aug 2011
    Posts
    12
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Phonon endless stream - any phonon expert out there?

    nobody? :S

Similar Threads

  1. Pan audio stream using Phonon
    By se_tony in forum Newbie
    Replies: 1
    Last Post: 21st September 2010, 20:44
  2. Live stream for Phonon video widget
    By Leolander in forum Qt Programming
    Replies: 0
    Last Post: 1st March 2010, 06:05
  3. Phonon V4L
    By kovariadam in forum Newbie
    Replies: 1
    Last Post: 31st January 2009, 15:35
  4. Playing a stream using phonon module
    By ram136682 in forum Qt for Embedded and Mobile
    Replies: 4
    Last Post: 28th August 2008, 14:42
  5. Is it possible to stream data from device with phonon ?
    By Elder Orb in forum Qt-based Software
    Replies: 0
    Last Post: 24th July 2008, 19:58

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.