Type WAVEHDR
lpData As String dwBufferLength As Long dwBytesRecorded As Long dwUser As Long dwFlags As Long dwLoops As Long lpNext As Long Reserved As Long End Type Type WAVEFORMAT wFormatTag As Integer nChannels As Integer nSamplesPerSec As Long nAvgBytesPerSec As Long nBlockAlign As Integer End Type Public wf As WAVEFORMAT, wh As WAVEHDR Public WBYTE() As Byte,lng as Long Sub Distort(FileIN as string, FileOUT as string) Dim cb As Integer, iB As Long Dim ff1 As Integer: ff1 = FreeFile On Error Resume Next Open FileIN For Binary Access Read As #ff1 Dim ff2 As Integer: ff2 = FreeFile Open FileOUT For Binary Access Write As #ff2 Get #ff1, , wh Get #ff1, , wf lng = LOF(ff1) ReDim WBYTE(lng) Get #ff1, Len(wh) + Len(wf), WBYTE() For iB = 0 To UBound(WBYTE()) cb = WBYTE(iB) cb = cb + (0.3 * (cb + 100)) If cb < 255 Then WBYTE(iB) = cb Else WBYTE(iB) = WBYTE(iB) End If Next Put #ff2, , wh Put #ff2, , wf Put #ff2, Len(wh) + Len(wf), EWBYTE() Close #ff1 Close #ff2 Exit Sub End Sub |