mp3 - Get Audio File Duration Via a Microsoft DLL or Utility -
is there windows dll or utility can used see duration (hh:mm:ss) of audio file (wma, mp3, or wav) can accessed script (specifically jscript)?
i know there one, or else can read file metadata, i'm unfamiliar it.
you can use getdetailsof
method of windows shell folder
object audio file length. technique supports audio file types metadata can read , displayed windows explorer natively.
however, note index of length attribute different on different windows versions: it's 21 on windows xp/2003 , 27 on windows vista+. see this page , this answer details. need take account in script.
example code:
var length = 27; // windows vista+ // var length = 21; // windows xp var oshell = new activexobject("shell.application"); var ofolder = oshell.namespace("c:\music"); var ofile = ofolder.parsename("track.mp3"); wscript.echo(ofolder.getdetailsof(ofile, length));
example output:
00:05:18
Comments
Post a Comment