Phonon and buffer of local file
I'm trying to play a file with Phonon. Eveything works just fine if the file is "as-it-should-be", I mean, the file has the size that it should have (non-corrupt mp3 file for example.)
The problem comes when I try to play a file that I'm asynchronously downloading.
If I do
Code:
self.mediaObject.setCurrentSource(Phonon.MediaSource("Path"))
file will play just for a sec or so (the bytes that were downloding while the app was creating the controls, etc...
Is there any way that I can tell Phonon that this file isn't complete and that it should read/wait for buffer?
Re: Phonon and buffer of local file
Nobody knows how to stream a local incomplete file?
Re: Phonon and buffer of local file
I don't know If I understand correctly, but this is probably what You should try to use:
Code:
self.
mediaObject.
setCurrentSource(Phonon.
MediaSource(QUrl("Path")))
Look also for Phonon::MediaSource::Type and try other types.
I personally use QUrl to play movies from HTTP, so I think it should handle.
If you want to download and play partially file that is currently downloaded, then this probably won't help You, although I can be wrong on this one.
Re: Phonon and buffer of local file
I'm already using the QUrl("Path") thingy. But what I'm trying to do is to play a file that I'm downloading at the same time, so that would be:
1. Start downloading file via async
2. Start playing local file
3. Play while not EOF (pause when buffer needed)
Re: Phonon and buffer of local file
AFAIK you could do something like this:
1. download file and store data in buffer
2. play buffer
MediaObject m;
QBuffer *someBuffer;
m.setCurrentSource(someBuffer);
3. save to file
Sorry but I can't help You more then this simply because I didn't used it before.
Re: Phonon and buffer of local file
Thanks! Tomorrow morning I'll read docs about buffer and I'll try it out ;)
Re: Phonon and buffer of local file
Hi,
I'm facing the same problem while playing audio. Did you find out the solution? If so then please share your knowledge.
Thanks in advance.