I'm using the following code below to get all the information from a wave file. Once this code is executed how can put all this information into an array with a format of binary or hex.
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 "c:\audio.wav" For Binary Access Read Lock Read As#1
Get #1, , MyStr: Debug.Print 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
ebug.Print "SamplesperSec= "; MyLong
SampleRate = MyLong
Get #1, , MyInt: Debug.Print "Bytes perSec=";MyInt
Get #1, , MyInt: Debug.Print "BlockAlign = ";MyInt
Get #1, , MyInt: Debug.Print"BytesperSample= ";MyInt
BytesPerSample = MyInt
Close #1
Debug.Print "Wave File Duration = "; _
FileSize / (SampleRate * BytesPerSample); " seconds"
End Sub
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 "c:\audio.wav" For Binary Access Read Lock Read As#1
Get #1, , MyStr: Debug.Print 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
SampleRate = MyLong
Get #1, , MyInt: Debug.Print "Bytes perSec=";MyInt
Get #1, , MyInt: Debug.Print "BlockAlign = ";MyInt
Get #1, , MyInt: Debug.Print"BytesperSample= ";MyInt
BytesPerSample = MyInt
Close #1
Debug.Print "Wave File Duration = "; _
FileSize / (SampleRate * BytesPerSample); " seconds"
End Sub