Skip to content

mopoa/TotalMediaTreeDuration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Total Directory Tree Media Duration(win32)

Do You wanna know your Video Course Total Length ??!!
this Program gives you the total media time of a directory tree

just Publish it with .NETCore and you are Done

piece of code

  TimeSpan DirectoryTreeTotalMediaDuration(string path)
       {
           TimeSpan duration = new TimeSpan(0, 0, 0);
               IEnumerator localDirectories = Directory.EnumerateDirectories(path).GetEnumerator();
               while (localDirectories.MoveNext())
               {
                   duration = duration + DirectoryTreeTotalMediaDuration(localDirectories.Current.ToString());
                   IEnumerator files = Directory.EnumerateFiles(localDirectories.Current.ToString()).GetEnumerator();
                   System.Console.WriteLine(localDirectories.Current.ToString());
                   while (files.MoveNext())
                   {
                       int fileLength = (int)wmp.newMedia(files.Current.ToString()).duration;
                       TimeSpan fileLengthspan = new TimeSpan(0, 0, fileLength);
                       duration = duration + fileLengthspan;
                   }
               }
           return duration;
       }

About

This CLI form program gives YOu Total Duration of medias in a directory tree.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages