I noticed there doesn’t seem to be any examples on creating a custom dsp in visual basic 6.
I attempted to get it working, but so far it doesn’t work and I’m not even getting any error messages.

Here is what I try:
[code:cucsg3fi]FMOD_System_Create system
FMOD_System_Init system, 32, FMOD_INIT_NORMAL, 0
result = FMOD_System_CreateSound(system, filename, FMOD_SOFTWARE Or FMOD_CREATESTREAM, sound)
result = FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sound, 0, channel)

dsp_description.name = "BPM Detection DSP"
dsp_description.Read = GetFunctionPointer(AddressOf dspCallback)

result = FMOD_System_CreateDSP(system, dsp_description, dsp)
result = FMOD_Channel_AddDSP(channel, dsp)

As far as I understand from the documentation, this should create and activate the dsp right?
I also tried adding FMOD_DSP_SetActive(dsp, 1) and FMOD_DSP_SetBypass(dsp, 0) but that didn’t make any difference.

The sound starts playing, but the dspCallback function is never called.

  • You must to post comments

Nobody used custom dsp’s in visual basic yet?
I’ve still not figured out what I may be doing wrong.

[b:2p4rblx6]Update:[/b:2p4rblx6] Ok, so comparing the header file and the visual basic declaration I’ve found one bug:
In the .h file, the ‘name’ is declared as 32 char’s.
In the visual basic header, it is a pointer to a string though.
The correct declaration in visual basic is:
[code:2p4rblx6] name As String * 32 ‘ [in] Name of the unit to be displayed in the network.[/code:2p4rblx6]

I now get a call to my dsp callback function, but visual basic crashes after this, so I’ll still have to find out what’s wrong there, but it’s at least one step closer…

[b:2p4rblx6]Update2:[/b:2p4rblx6] By debugging I found that the dsp callback function is called, and that the parameters that are being passed seem correct (inChannels, outChannels and length).
However, any function that is being performed after that seems to lead to a crash.
I’m afraid this might be a problem with visual basic handling callbacks in different threads, although I have used callbacks successfully before.

[b:2p4rblx6]Update 3:[/b:2p4rblx6] As with Fmod 3, apparently callbacks only work when the compiler is set to P-Code, instead of Native Code. This means that the code is interpreted if I’m not mistaken, and thus will be a lot slower.
For now I’ll probably use a dll to do the dsp callback, but if anyone knows if it’s possible to get fmod callbacks working in visual basic w/ native code, please let me know.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.