Re: Wish list
- Thanks for the suggestions, Eb. I always appreciate ideas since one never knows what ideas they may trigger.
The first idea does not work for me since I don't want to modify file names for many reasons. The second idea sounds good, but there is little correlation between file size and playing length. It is a surprisingly complicated area where different .avi files (for example) can be encoded by different algorithms and .mp3 files are encoded with different bit rates which is a trade off between size and quality. I even hear multiple bit rates can be used in the same file although this is probably rare.
All I know is, length can obviously be found (many programs including Windows Explorer) can do it, but it is not trivial to just grab the value for a given file by most languages. I suppose this is vastly beyond the scope of NT, but I don't know for sure which is why I'm wishing!
Please understand I'm not an expert in this area so nobody needs to point out any slight errors I made in my explanations.
--- In firstname.lastname@example.org, "Eb" <ebbtidalflats@...> wrote:
> Hi Joy,
> Depending on accuracy needed, I would suggest two approaches.
> You mention, that you already use an external utility. Why not use it to determine the playing time for each file and append this time to the filename?
> Or you could roll your own:
> I'm not into multimedia, but if I were, and lacking other tools, I'd determine a factor of playing time to file size once, for each filetype, store these, and other info, in a custom ini, under each each media type. Perhaps under groups named by the file extension.
> Conversion factor (bytes per second/minute) and overhead for media management in filesize, may be all you'd need.
> You could then approximate playing time, by accessing this data for each file. Something like:
> ^!Set %playtime%=0
> ^!SetArray %medialist%=^$GetFiles...
> ^!Set %file%=^%medialist^%medialist0%%
> ^!Set %type%=^$GetExt(^%file%)$
> ^!Set %xref%=^$GetValue(^%type%:xref)$
> ^!Set %overhead%=^$GetValue(^%type%:overhead)$
> ^!Set %time%=^$GetFileSize(FileName)$
> ^!Set %time%=^$Calc((^%time%-^%overhead%)*^%xref%;0)$
> ^!Inc %playtime% ^%time%
> ^!Dec %medialist0%
> ^!If ^%medialist0%>0 LOOP
> --- In email@example.com, "joy8388608" <mycroftj@> wrote:
> > A function to do it directly with NT
> > > > ... a function to provide the playing time of audio and video files (.mov, .avi, .mp3, etc.) ... find (playing time)
> > > > to fit on a 60 minute CD, etc.
> > > > find the playing time values outside of NT