0
0

Hello and thanks for this ingenious library.

But I have a problem with fmod 3.74.

If I select FSOUND_OUTPUT_DSOUND as output, I get a “invalid floating point operation” with the last TRUNC function.

Happens however only under Windows 2000.

I use Delphi 5 Ent under Windows XP Prof with Sp2.

DirectX 9 installed, sound driver installed.

I do not understand that.

Sorry about bad English. 😳

  • You must to post comments
0
0

your code would help

  • You must to post comments
0
0

[quote="birty":2zxbn9vv]your code would help[/quote:2zxbn9vv]

Here the initialization of fmod, functions marvelously.

[code:2zxbn9vv]
...

if not FMOD_Load (nil) then EXIT;

if not FSOUND_SetOutput (FSOUND_OUTPUT_DSOUND) then EXIT;

{ Set the driver }
if not FSOUND_SetDriver (0) then EXIT;

{ Set the mixer }
if not FSOUND_SetMixer (FSOUND_MIXER_AUTODETECT) then EXIT;

FSOUND_SetBufferSize (100);

if not FSOUND_Init (44100, 128, FSOUND_INIT_GLOBALFOCUS or FSOUND_INIT_ENABLESYSTEMCHANNELFX or FSOUND_INIT_ACCURATEVULEVELS) then EXIT;

...
[/code:2zxbn9vv]

But if in the code a TRUNC function is called sometime, there is an invalid floating point operation.
it happens with the TRUNC called last function.

I use the normal TRUNC function of Delphi 5.

I already found the following thread, but that is not which I wants.
I would not like to replace each TRUNC function or take ROUND.

[url:2zxbn9vv]http://www.fmod.org/forum/viewtopic.php?t=955[/url:2zxbn9vv]

  • You must to post comments
0
0

[quote="http://www.brenemanlabs.com/Depends.htm":8oe7teze]The “Invalid floating point operation” exception can be caused by using a DLL for which FPU exceptions are disabled. That search mentioned above (for “ezerodivide Win98”) will also turn up an interesting message from Danny Thorpe (on 4 Sept. 2003) about Delphi-5 Trunc() problems (per Danny this was resolved in Delphi-6)[/quote:8oe7teze]
i think the only way you can aviod this is to upgrade to a newer version of delphi or just put exception handling round each call to trunc like this:
[code:8oe7teze]
try
int:=trunc(flt);
except;
end;[/code:8oe7teze]

  • You must to post comments
0
0

[quote="birty":217ah5na][quote="http://www.brenemanlabs.com/Depends.htm":217ah5na]The “Invalid floating point operation” exception can be caused by using a DLL for which FPU exceptions are disabled. That search mentioned above (for “ezerodivide Win98”) will also turn up an interesting message from Danny Thorpe (on 4 Sept. 2003) about Delphi-5 Trunc() problems (per Danny this was resolved in Delphi-6)[/quote:217ah5na]
i think the only way you can aviod this is to upgrade to a newer version of delphi or just put exception handling round each call to trunc like this:
[code:217ah5na]
try
int:=trunc(flt);
except;
end;[/code:217ah5na][/quote:217ah5na]
Thanks for the answer.

If I do not use my Equalizer, then I do not get the error!

Here is my code.

[code:217ah5na]
type
TEQBand = record
Band : integer;
Centerfreq : double; // range from 80 to 16000 Default is 8000
CentfreqStr : string;
Bandwidth : double; // range from 1 to 36. Default is 12
Gain : double; // -15 to 15 Def. 0
end;

...

var
aEQBands: array [0..15] of TEQBand =
(
(Band: 0; Centerfreq: 80; CentfreqStr: ’80’; Bandwidth: 18; Gain: 0 ),
(Band: 0; Centerfreq: 100; CentfreqStr: ‘100’; Bandwidth: 18; Gain: 0 ),
(Band: 0; Centerfreq: 125; CentfreqStr: ‘125’; Bandwidth: 18; Gain: 0 ),
(Band: 0; Centerfreq: 250; CentfreqStr: ‘250’; Bandwidth: 18; Gain: 0 ),
(Band: 0; Centerfreq: 310; CentfreqStr: ‘310’; Bandwidth: 18; Gain: 0 ),
(Band: 0; Centerfreq: 500; CentfreqStr: ‘500’; Bandwidth: 18; Gain: 0 ),
(Band: 0; Centerfreq: 600; CentfreqStr: ‘600’; Bandwidth: 18; Gain: 0 ),
(Band: 0; Centerfreq: 800; CentfreqStr: ‘800’; Bandwidth: 18; Gain: 0 ),
(Band: 0; Centerfreq: 1000; CentfreqStr: ‘1k’; Bandwidth: 18; Gain: 0 ),
(Band: 0; Centerfreq: 2000; CentfreqStr: ‘2k’; Bandwidth: 18; Gain: 0 ),
(Band: 0; Centerfreq: 3000; CentfreqStr: ‘3k’; Bandwidth: 18; Gain: 0 ),
(Band: 0; Centerfreq: 6000; CentfreqStr: ‘6k’; Bandwidth: 18; Gain: 0 ),
(Band: 0; Centerfreq: 8000; CentfreqStr: ‘8k’; Bandwidth: 18; Gain: 0 ),
(Band: 0; Centerfreq: 12000; CentfreqStr: ’12k’; Bandwidth: 18; Gain: 0 ),
(Band: 0; Centerfreq: 14000; CentfreqStr: ’14k’; Bandwidth: 18; Gain: 0 ),
(Band: 0; Centerfreq: 16000; CentfreqStr: ’16k’; Bandwidth: 18; Gain: 0 )
);

...
FSOUND_SetPaused (FSOUND_SYSTEMCHANNEL, TRUE);

iIdx:= Low (aEQBands);
while iIdx <= High (aEQBands) do begin
aEQBands [iIdx]. Band:= FSOUND_FX_Enable (FSOUND_SYSTEMCHANNEL, FSOUND_FX_PARAMEQ);
Inc (iIdx);
end;

FSOUND_SetPaused (FSOUND_SYSTEMCHANNEL, FALSE);

...

iIdx:= Low (aEQBands);
while iIdx <= High (aEQBands) do begin
FSOUND_FX_SetParamEQ (aEQBands [iIdx]. Band, aEQBands [iIdx]. Centerfreq, aEQBands [iIdx]. Bandwidth, aEQBands [iIdx]. Gain);
Inc (iIdx);
end;

...
[/code:217ah5na]

  • You must to post comments
0
0

Sometimes got the same problem when using the timer function (Visual Basic) first time after init or close.
Try catch this error like punker76 says (Win98se, SB Live Value, Dx9c, fmod 3.xx)

  • You must to post comments
Showing 5 results
Your Answer

Please first to submit.