Determining the length of a file using aRts
Jason Wood
jasonwood at blueyonder.co.uk
Mon Sep 16 05:44:58 BST 2002
On Monday 16 Sep 2002 4:37 am, Charles Samuels wrote:
> Sunday 15 September 2002 08:23 pm, skrev Jason Wood:
> > On Monday 16 Sep 2002 3:47 am, Charles Samuels wrote:
> > > Sunday 15 September 2002 07:43 pm, skrev Jason Wood:
> > > > The only method I have using aRts at present is to open a play
> > > > object, wait for it to start playing, test it in various ways to
> > > > discover when the overallTime() function is returning a valid value,
> > > > and then to stop and close the playobject again. This is not a method
> > > > I can use in my application.
> > >
> > > You don't need to wait for it to start playing. Just until after you
> > > open it.
> >
> > Sorry, I should clarify that where I said open, I meant that I create a
> > Play object (in particular, a KPlayObject, though I don't think that is
> > important in this case).
> >
> > Is there a difference between opening a PlayObject and playing one? In
> > other words, is there some method equivalent of a PlayObject->prepare(),
> > or a PlayObject->open() (having checked the docs I can't see anything
> > obvious)
> >
> > If I try to read the overallTime() of the PlayObject without playing it
> > first (i.e. I have just created it), it always comes back with a duration
> > of 0.
> >
> > If I try to play it first, it seems to take a couple of seconds to "warm
> > up". I have to wait until the overallTime() changes to non-zero by
> > repeatedly testing it.
>
> That sounds like a bug in mpeglib. Something you should fix :)
The same problem occurs with ogg files, so I'm not convinced this is an
mpeglib specific problem. (I assume mpeglib is used for mp3's only...???)
However, I have now checked the above with wav files and they do show the
expected behaviour, so at least I know the API is already in place!
Cheers,
Jason
--
Jason Wood
Homepage : www.uchian.pwp.blueyonder.co.uk
More information about the kde-multimedia
mailing list