
Announcements
Hi guys! I am building a flow and i need a subflow to read the length of an audio file. Do any of you know how to do this? Thanks
Hi @Dollaru
You can do this by reading the metadata of the file.
Paste the below code into a blank Desktop Flow editor, change the file path and run.
SET FullFilePath TO $'''C:\\Test\\FileName.mp3'''
File.GetPathPart File: FullFilePath Directory=> Directory FileName=> FileName
Scripting.RunVBScript VBScriptCode: $'''Dim oAppShell, oFolder, output
Set objFso = CreateObject(\"Scripting.FileSystemObject\")
Set oAppShell = CreateObject(\"Shell.Application\")
varFolderPath = \"%Directory%\"
Set oFolder = oAppShell.Namespace(varFolderPath)
File = \"%FileName%\"
output = oFolder.GetDetailsOf(oFolder.items.Item(File),27)
WScript.Echo output''' ScriptOutput=> VBScriptOutput
Display.ShowMessageDialog.ShowMessage Message: $'''The length is: %VBScriptOutput%''' Icon: Display.Icon.None Buttons: Display.Buttons.OK DefaultButton: Display.DefaultButton.Button1 IsTopMost: False ButtonPressed=> ButtonPressed