Author Topic: Please Winamp Plugin FX IN VB  (Read 7417 times)

lagarto

  • Posts: 34
Please Winamp Plugin FX IN VB
« on: 18 Aug '03 - 03:59 »
Somebody can help myself to reproduce two audio files with in Plugin FX Winamp in VB...

I already tried with WinampDSP.ocx for RegG without success.

Please...  :'(

Chris

  • Posts: 2217
Re: Please Winamp Plugin FX IN VB
« Reply #1 on: 18 Aug '03 - 05:29 »
Hi  I`m only a Delphianer but I have make a little Look
at the VB-Source of WinampDSPVBSource.
(much in Visual Basic is similarly as in Delphi)

Stupid error
Just Change this 2 Lines  in the frmPath.frm
Remove
Code: [Select]

Private Sub Form_Load()
  Drive1.drive = "c:"
  Dir1.Path = "c:\program files\winamp\plugins\"
End Sub




Remove this Form_load procedure and and all will work....

Greets Chris

« Last Edit: 18 Aug '03 - 05:37 by Chris »

lagarto

  • Posts: 34
Re: Please Winamp Plugin FX IN VB
« Reply #2 on: 18 Aug '03 - 13:02 »
OK. Thank you Chris. But actually that is not my problem. My problem is the following, I need to execute two audio files MP3 with effect, but when I try to mix the two files, it is with the distorted sound. Will it be that anybody could not help myself?  :'(

Chris

  • Posts: 2217
Re: Please Winamp Plugin FX IN VB
« Reply #3 on: 18 Aug '03 - 15:46 »
Mmm if I right understand  you have to streams with an effect and you want to mix the 2 streams to a final mix right ??

I recommend this Post
http://www.un4seen.com/YaBB.cgi?board=bass&action=display&num=1038170286#5
it shows how to mix 2 or more Streams to a final mix
(the code is C++ / delphi)  but i think its possible
to convert it.....to VB...

Chris
« Last Edit: 18 Aug '03 - 16:00 by Chris »

lagarto

  • Posts: 34
Re: Please Winamp Plugin FX IN VB
« Reply #4 on: 18 Aug '03 - 18:53 »
::) OK Chris. I think now you understood my problem. My code source this below. Will it be that you can help myself?


Public m_hStreamA(2) As Long
Public m_hPlayHandleA(2) As Long

Public Const decblock = 4608
Public excess(decblock * 2) As Byte
Public exlen As Long

Public freq As Long

Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (ByRef Destination As Any, ByRef Source As Any, ByVal length As Long)

Public Function STREAMPROC(ByVal Channel As Long, ByVal buffer As Long, ByVal length As Long, ByVal user As Long) As Long
    On Error Resume Next
    Dim decbuff(decblock * 2) As Byte
    Dim tempbuffer() As Byte
    ReDim tempbuffer(length) As Byte
    Dim a As Long
    Dim c As Long
    Dim nBufferPos As Long
    nBufferPos = 0
    c = length
    If exlen Then
       a = 0
       If (c < exlen) Then
           a = c
       Else
           a = exlen
       End If
       Call CopyMemory(tempbuffer(nBufferPos), excess(0), a)
       exlen = exlen - a
       Call CopyMemory(excess(0), excess(a), exlen)
       nBufferPos = nBufferPos + a
       c = c - a
   End If
   Do While (c)
       a = BASS_ChannelGetData(m_hStreamA(1), decbuff(0), decblock)
       If a < 0 Then Exit Do
       If frmMain.StartedA Then
           a = 4 * frmMain.DSP.ModifySamples(VarPtr(decbuff(0)), a / 4, 16, 2, 44100)
       End If
       If (a > c) Then
           Call CopyMemory(tempbuffer(nBufferPos), decbuff(0), c)
           exlen = a - c
           Call CopyMemory(excess(0), decbuff(c), exlen)
           c = 0
       Else
           Call CopyMemory(tempbuffer(nBufferPos), decbuff(0), a)
           nBufferPos = nBufferPos + a
           c = c - a
       End If
   Loop
   Call CopyMemory(ByVal buffer, tempbuffer(0), length - c)
   STREAMPROC = length - c
End Function