Determining the length of a file using aRts

Charles Samuels charles at kde.org
Mon Sep 16 04:37:06 BST 2002


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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:
> > > Hi,
> > >
> > > My application needs to be able to determine the length of an
> > > audio/movie clip as quickly as possible, but I am having trouble
> > > determining the best way to do this.
> > >
> > > 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 :)

- -Charles

- -- 
Charles Samuels <charles at kde.org>
### <charles at altair.dhs.org> is obsolete, please update your addressbook.
 "The world is my circuit board, and I am the electron."
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE9hVHlWS4Pv66UcxkRAt1jAJ9T32jKgLR51XB9t9auBU0d1+UrCQCgmxe4
3R7kMhy6mHRN9B80OtxDr0c=
=yPwm
-----END PGP SIGNATURE-----



More information about the kde-multimedia mailing list