Hello !
I am new in fmod and I am coding a sound engine for a game.
I’ve correctly implemented fmod in the game, but I have a little problem :

When I want to add FX effects with FSOUND_ENABLEFX in the FSOUND_Sample_Load() function,
the 3d system dont work …

Here is my code :
void SoundPlay( vec3_t origin, char *soundname, int vol, int pitchscale )
sample_s *sample = 0;
FSOUND_SAMPLE *samp = 0;
char sound[256];
int channel;
float pitch;

sprintf( sound, "%s/sound/%s", gEngfuncs.pfnGetGameDirectory(), soundname );

samp = FSOUND_Sample_Load(FSOUND_FREE, sound, FSOUND_HW3D | FSOUND_ENABLEFX, 0, 0);
if (!samp)
    gEngfuncs.Con_Printf("%s\n", FMOD_ErrorString(FSOUND_GetError()));

channel = FSOUND_PlaySoundEx(FSOUND_FREE, samp, NULL, TRUE);

FSOUND_3D_SetAttributes(channel, origin, NULL);
FSOUND_SetVolume(channel, vol );

pitch = FSOUND_GetFrequency( channel );
pitch *= float(pitchscale)/100;
FSOUND_SetFrequency( channel, (int)pitch );

int eq1 = FSOUND_FX_Enable(channel, FSOUND_FX_PARAMEQ);
int eq2 = FSOUND_FX_Enable(channel, FSOUND_FX_PARAMEQ);
int echo1 = FSOUND_FX_Enable(channel, FSOUND_FX_ECHO);

FSOUND_FX_SetEcho(echo1,  8.0f, 50.0f, 490.0f, 500.0f, TRUE);
FSOUND_FX_SetParamEQ(eq1, 8000, 36, -15);
FSOUND_FX_SetParamEQ(eq2, 16000, 36, -15);

FSOUND_SetPaused(channel, FALSE);


The fx work but not the 3d.

Thank for your help and your great software 😉

ps: I am french, sorry for my english …

  • You must to post comments

How I can done to use FSOUND_ENABLEFX and FSOUND_HW3D in same time without the 3d bug please ?

  • You must to post comments

hum, after some reflexion, I discovered that the “DrySFXUnit” is useless …
I tried to replace it with NULL, and all work normaly … ( I have tested on the dsp.exe project )
Thus, for what that is used ?

  • You must to post comments

Yes, without the FSOUND_ENABLEFX, 3d work fine !
But I’ve just seen the 3d system fail.

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.