I have a weird problem. When I run the FMOD sample program in VB6 it tells me there is a division by zero error and the program asks if I want to debug.
If I ‘debug but do nothing and just have the program continue it seems to work perfectly. Can I fix this nuissance?
- kamochan asked 15 years ago
I had this before too, well actually a user that was betaing my player had this, oddly it only affects some users.
To fix it i had to split up some of my fmod calls. Basically giving it time to startup, at least thats what I figured, once i spaced out my calls over a period of functions, which was easier to read anyhow, the problem disappeared. I am going to assume u are getting this error on tracker modules right?
Thanks. I’ll try that out. For the record, the error points to the lines
lp_cutoff = 5000
lp_reson = 1
and if I comment those out it then points to
lblProcessor = Format(FSOUND_GetCPUUsage, “00.00”) & “%”
If I comment all those lines out the error disappears, but (and sorry I’m new to this) I don’t know what those lines do (I can guess, especially the GetCPUUsage part) so I don’t really want to take them out.
- kamochan answered 15 years ago
I´m having the same problem frequently. It seems to be a bug in fmod since I haven´t used a computation with a devision by zero.
Also VB frequently states that an error occurs when running fmod and then it shuts down the whole app. E.g. when I am running the code of ´Here’s some code for a smooth VB-VU´ (see the list of topics) I get the same errormessage.
<font size=-1>[ This Message was edited by: Ultrasaurus on 2002-03-16 05:19 ]</font>
- Ultrasaurus answered 15 years ago
Just my two cents, but when setting a Label control’s Caption, you should be explicit with the property to avoid problems:
lblBlah.Caption = “blah”
I’ve got a very detailed application going with VB and Win32 API and FMOD of course, and have yet to ever see a Div by 0 error. Must be something specific about the particular functions you’re using in FMOD? GetCPUUsage and all the Stream/Channel/Info functions work great here for mp3/wav playback. I don’t have a need for MODule formats tho.
- K6Deux answered 15 years ago
I just thought of another option that might remove some bugs.
I had some bugs (i dont’t remember if it were division by zero errors, but it were strange errors) and they were solved when I disabled Optimization (No Optimization option in the project options)
It might be worth trying.
- Adion answered 15 years ago
I also got a problem a problem like this! Unfortunately I don’t remember precisely how I resolved it, but:
1) Be careful with initialization of the Brett’s lowpass filter (the same included with fmod example) because if you don’t initialize it with correct values, it will return a division by zero error.
2) If your lbl.caption=FSOUND_GetCpuUsage statement is in a timer, it may happen that the function is called before fmod initialization, giving a division by zero error.
3) (But I don’t think this is your case) Watch out for MMX and FPU instructions if your code contains assembly.
Please login first to submit.