I would like it very much if someone can tell me how to use DSP in vb, I already have the new FMOD dll with supports stdcall callbacks, but I don’t know how to use the DSP functions in VB.
Things Iam most interested in is an equalizer without the use of DirectX and some reverseB effects.
If someone can send me an example on how to do it would also be great…
Ok, If anyone is interested, I have written my oscilliscope callback and it works pretty good, Heres the code:
This is the callback function to get the data directly from FMOD.
Public Function ScopeCallback(ByVal originalbuffer As Long, ByVal newbuffer As Long, ByVal length As Long, ByVal param As Long) As Long
If UseSpectrum = False Then BufSize = length * 2 'Settings.Mixer_Type <> 0 will detect if the mixer if FPU or not. 'For a substitute of this you can use FSOUND_GetMixer.' If Settings.Mixer_Type <> 0 Then ReDim ScopeBufferINT(0 To BufSize) As Integer GetScopeINT ScopeBufferINT, newbuffer Else ReDim ScopeBufferFPU(0 To BufSize) As Single GetScopeFPU ScopeBufferFPU, newbuffer End If End If 'VERY IMPORTANT! ScopeCallback = newbuffer
These are the functions that I wrote to convert the buffer into a VB array. GetScopeINT will convert the buffer into an array of integers, and GetScopeFPU will convert the buffer into an array of singles, which is needed if you use the FPU mixer.
Private Function GetScopeINT(ByRef ScopeData() As Integer, ByVal lpBuffer As Long)
CopyMemory ScopeData(0), ByVal lpBuffer, UBound(ScopeData) * 2
Private Function GetScopeFPU(ByRef ScopeData() As Single, ByVal lpBuffer As Long)
CopyMemory ScopeData(0), ByVal lpBuffer, UBound(ScopeData) * 4
If you have any questions ask me!
Exactly, that is what I am trying to do now. I am having problems with copymemory. For some reason after using copymemory with my callback I must compile the project in P-Code, instead of the standard Native Code, If I compile in native code I get an error with msvbvm60.dll. Its really strange.
What you have to do is write a callback function which will analyze the digital signal so that you can use DSP on it. And by using the AddressOf function in VB you can use the FMOD DSP functions to call on your Callback function. It is a bit complicated and I have never done it.
Please login first to submit.