How to get time long of audio by uipath

Hi anyone, i find the way to get timing of audio file but cant get information of [detail] tab in [Properties] file. Can you help me?

you can use fileinfo syntax for get details


Could you please explain a bit more?

With the snaps where we’re not getting the properties?


there activity called get fileinfo you can use that activity to get file information
create out put variable the output data type will be file info , for get creation time use
str_creationtime = outputvar.creationtime

It only get some infor as name file, date,last date But in tab Detail its cant get info, i wwant to get infor like image

I want to get time length, and some information in Detail tab of file.

thats not possible you get directly , you can only do with foreground automation

like navigate to the particular folder path and right click on file then you can choose properties

after you have to take screenshot

Thanks you, it can have a solution to get infor detail diectly, and im seeking.


For length you can try like this

Assign StrLength = new System.IO.FileInfo("FilePath").Length.ToString


Thanks you, let me try.

can you look on this link?


Have a view on this thread as well



The following approach might help you.

static extern Int32 mciSendString(string command, System.Text.StringBuilder buffer, int bufferSize, IntPtr hwndCallback);
string cmd;
var buffer = new System.Text.StringBuilder(new string((char)0,255));

cmd ="set time format milliseconds";

cmd ="status \""+fileName +"\" length";

ret = buffer.ToString();	

Sequence.xaml (6.4 KB)


it doesnt work,thanks.

Thanks, its seem good idea, but not work on my machine, can be something wrong in your.

It’s amazing how many people don’t carefully read questions. He doesn’t want the size of the file, people, he wants the LENGTH IN TIME of the audio file.

Anyway @Bin_Bin there doesn’t appear to be a simple way to do this programmatically.

Have you tried opening it in Windows Media Player and getting the time from there?

yes, it is one of solutions, i see the @Yoichi solution can be feasibility, but i dont know about programing language to write code. Anyone could help me the way how to add class library into uipath? i find C# solution, but i dont know how to add MP3Header Class library into uipath.
this is website of solution : .net - How to get the length of a MP3 in C# - Stack Overflow

Well, have you tried it? It would be the simplest way to get the audio length.

By the way, I’m not sure why you’re having trouble getting it from the file Properties. Works fine for me:

yes thanks, its good i dea, and i want one more idea can work in console mode.