After initializing in directsound (and sometimes when closing fmod) in visual basic, visual basic always has an error when using the timer function (Overflow, or division by zero …). This error occurs once only the first time the timer function is used after each init (/close). I’m not sure if/what other visual basic functions are affected, the timer function is the only one I know.
This may be a general vb related problem, but maybe someone knows why it occurs???
It’s no problem to bypass this error, but it should not even exist. Don’t bother me with workarounds.
The error occurs when initializing fmod… here the way I use it:
xoutput / xsndcard are
here’s the small example
‘ The declarations (private because used in current form/modul only
Private Declare Function FSOUND_SetOutput Lib “fmod.dll” Alias “_FSOUND_SetOutput@4” (ByVal outputtype As Long) As Byte
Private Declare Function FSOUND_SetDriver Lib “fmod.dll” Alias “_FSOUND_SetDriver@4” (ByVal driver As Long) As Byte
Private Declare Function FSOUND_SetBufferSize Lib “fmod.dll” Alias “_FSOUND_SetBufferSize@4” (ByVal lenms As Long) As Byte
Private Declare Function FSOUND_SetHWND Lib “fmod.dll” Alias “_FSOUND_SetHWND@4” (ByVal hwnd As Long) As Byte
Private Declare Function FSOUND_Init Lib “fmod.dll” Alias “_FSOUND_Init@12” (ByVal mixrate As Long, ByVal maxchannels As Long, ByVal Flags As Long) As Byte
‘ program excerpt:
Call FSOUND_SetOutput(xOutPut – 1&)
Call FSOUND_Init(44001, 256, &H2)
xLong1 = Timer
‘ In IDE, vb has an overflow or similar error, but when resuming it continues because it’s not really an visual basic error.
I tested also calling the timer function after setoutput, sethwnd… but the error doesn’t occur, only after fsound_init
Same when closing fmod. I previously had this problem on unloading fmod only with fmod < 3.5, but now sometimes with fmod 3.73 (so fmod 3.73 previously worked without this problem).
Private Declare Function FSOUND_Close Lib “fmod.dll” Alias “_FSOUND_Close@0” () As Long
xLong1 = Timer
- You must login to post comments