Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

return timing duration of .wav as String

Status
Not open for further replies.

benjatado

Programmer
May 15, 2005
52
US
I am looking for a way to retrieve the timing/duration of a .wav file to String or Integer through VB.

I have a file scanning application that scans contents of a dir and returns file info using the FileInfo method of the System.IO class - but retrieving the duration/timing of a media file is not a method in this class.

Any suggestions or knowledge of what class and method I could use to pull back this timing/duration information of a media (.wav/.wma/.mp3) file?

Here is the snippet of code I have for the retrieval of info display currently using the FileInfo method...

Code:
...
Sub Scanfolder(ByVal currDir As String)
     If interrupt Then Exit Sub
 Dim Dir As String
 Dim File As String
 Dim FI As FileInfo
 For Each File In Directory.GetFiles(currDir)
     FI = New FileInfo(File)
     FilesList.Items.Add(FI.DirectoryName & vbTab & FI.Name & vbTab & FI.Length & vbTab & FI.CreationTime)
...

any help or pointers here will be greatly appreciated!

Thanks,

benja
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top