How Long is a Sound [Without Using Quicktime]?

Dar Scott dsc at swcp.com
Thu May 30 16:45:35 EDT 2013


I don't have a good solution but here are some crazy ideas...

If these are all sounds you supply, you can write a script that times all the sounds in some folder (or stack) and creates a table.

If you know these all are the same bit rate and the same number of channels, and there is no compression in the format, then maybe you can estimate from the file length.  Tweak an offset to cover headers and trailers.

Maybe there are some command-line tools that can work with shell().  I quick search brought up names like mp3info, soxi, afinfo, mp3split, and sox.

Or, if you handle only a small number of sound formats, parse the files.

Dar


On May 30, 2013, at 1:36 PM, Ray Horsley wrote:

> I know this is available with QuickTime using the CurrentTime and TimeScale properties but if the user doesn't have QuickTime installed I'd hate to be stuck.  Are there any other ways to get the duration of an audio file?
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list