joining wave files

yogi21

Member
Joined
Apr 14, 2003
Messages
6
hey
i trying to merge several wav files together. i found some sample code but still have problems because i use vb 7.0 and it does not know clsWaveIO.
can anybody help me.
thanx
the sample code is below....

clsWaveOUT.Length = 0
clsWaveOUT.DataLength = 0

Gather header data
For u = 0 To ListBox1.Items.Count - 1
clsWaveIN.WaveHeaderIN(ListBox1.Items(u).ToString())
clsWaveOUT.DataLength = clsWaveOUT.DataLength + clsWaveIN.DataLength
clsWaveOUT.Length = clsWaveOUT.Length + clsWaveIN.Length
Next u

Recontruct new header
Dim txtoutput As String
txtoutput = "C:\Documents and Settings\Johan-Iliane\My Documents\Visual Studio Projects\gerhardt\Studienarbeit\Studienarbeit\output.wav"
clsWaveOUT.BitsPerSample = clsWaveIN.BitsPerSample
clsWaveOUT.Channels = clsWaveIN.Channels
clsWaveOUT.SampleRate = clsWaveIN.SampleRate
clsWaveOUT.WaveHeaderOUT(txtOutput)


Recontruct wave
For u = 0 To ListBox1.Items.Count - 1
ifree = FreeFile()

ReDim arrFile(FLen(ListBox1.Items(u).ToString()) - 45)
Open ListBox1.Items(u).ToString() For Binary Access Read As #ifree
Get #ifree, 45, arrFile()
Close #ifree

ifree = FreeFile()
Open txtOutput For Binary Access Write As #ifree
Put #ifree, FLen(txtOutput) + 1, arrFile()
Close #ifree

ListBox1.ListIndex = j
Me.Caption = Int(100 / lstFilePath.ListCount * i + 1) & "%"
If cmdMerge.Caption = "Merge" Then Exit Sub
DoEvents()
Next u
 
Can you download clsWaveIO from the website the sample was on, .Net lacks a built in multimedia class for some reason
 
Back
Top