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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WaveInfo

Status
Not open for further replies.

clarkm2

Programmer
Jun 12, 2003
11
0
0
US
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:Debug.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

 
clarkm2

As a relatively new member to Tek-Tips, you may not be aware that anyone who takes the time to answer a question is doing so voluntarily and giving of their time. It appears that in the six questions that you've asked so far, that you've yet to acknowledge anyone's help, and some have to be wondering if their suggestions have made any difference. You might want to consider saying 'thank you' to those who have helped you.

I notice that you have started 6 threads on the same subject
the others are
thread222-576033
thread222-575056
thread222-577496
thread222-576057
thread222-582715
Please, in the future, ask extra questions in the same thread, as to do that would make much easier for everyone to follow. This helps everyone!

Finally, may I suggest you read johwm's[\b] FAQ FAQ222-2244 which will give you much help in getting and giving the best form & to the forum.

Just to get you started along the lines to a solution, maybe a UDT or class would be better than an array.

Take Care

Matt
If at first you don't succeed, skydiving is not for you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top