
Originally Posted by
edmscan
I do apologize saying that it would not work .. it does, but I need to calculate the length of each file. That may be a bit tricky.
But I will see what I can do. I am fine with adding that to the table .. as I am not going to be dealing with a lot of files at once.
So .. thanks, I am sure that someone will appreciate this as well in the future.
Btw .. the code I posted above does work for things like batch files that are external to Access.
Btw .. found this code that may give me what I want.
Private Sub Command1_Click()
Dim MyInt As Integer
Dim MyByte As Byte
Dim MyStr As String * 4
Dim MyLong As Long
Dim SampleRate, BytesPerSample, FileSize As Long
Open "d:\tmp.wav" For Binary Access Read Lock Read As #1
Get #1, , MyStr: Debug.Print "Riff = "; MyStr
Get #1, , MyLong: Debug.Print "File size = "; MyLong
FileSize = MyLong
Get #1, , MyStr: Debug.Print "Wave = "; MyStr
Get #1, , MyStr: Debug.Print "Format = "; MyStr
Get #1, , MyLong: Debug.Print "Any = "; MyLong
Get #1, , MyInt: Debug.Print "formatTag = "; MyInt
Get #1, , MyInt: Debug.Print "Channels = "; MyInt
Get #1, , MyLong: Debug.Print "Samples per Sec = "; MyLong
SampleRate = MyLong
Get #1, , MyInt: Debug.Print "Bytes per Sec = "; MyInt
Get #1, , MyInt: Debug.Print "BlockAlign = "; MyInt
Get #1, , MyInt: Debug.Print "Bytes per Sample = "; MyInt
BytesPerSample = MyInt
Close #1
Debug.Print "Wave File Duration = "; _
FileSize / (SampleRate * BytesPerSample); " seconds"
End Sub