[Gambas-user] Music.Length part 2
Benoît Minisini
gambas at ...1...
Wed Apr 23 17:51:14 CEST 2014
Le 23/04/2014 17:38, Patrik Karlsson a écrit :
> Hi,
>
> it's almost 6 years since I wrote the first post [1] regarding Music.Length
> I recently picked up Gambas again and I am about to finish this little
> project now. :)
>
> As far as I can tell, there is still no easy "Gambas way" to get the length
> of an audio file, right?
>
> Would it be possible to implement such a function now?
> It would be really nice to have Music.Play return the length in seconds as
> float and a pure Music.Length function.
>
> In the previous thread I got some answers regarding command line tools, but
> in this case my audio files are bundled in the project.
>
> /patrik
>
> [1]
> http://sourceforge.net/p/gambas/mailman/gambas-user/thread/577069a50806200210i701ff536pf4e655c4cfc45ff9%40mail.gmail.com/#msg19733859
You should use the gb.media component instead. Look at the "MediaPlayer"
example, it displays the length of the video/audio file it plays.
I admit that playing a file to know its length is a bit stupid. It
should be possible to create a GStreamer pipe to just know the length of
a multimedia file without playing it.
--
Benoît Minisini
More information about the User
mailing list