Example for the C Api

(Luis Enrique Vargas) #1

Hi everyone, I’m going to use FMod win Mingw64, I read that I can use the DLLs directly without the import lib as long as I use the C api instead of the C++.
I was checking in the examples folder of the API and all the examples are in C++.
Is there any downloadable example for the C Api that I can use to start compiling?

(Brett Paterson) #2

Hi Luis,
The C usage is nearly identical to the C++ usage, you just put the object as the first parameter, and use the FMOD_(classname)_ prefix in front of the function name.


result = system->createDSPByType(FMOD_DSP_TYPE_OSCILLATOR, &dsp);
result = dsp->setParameterFloat(FMOD_DSP_OSCILLATOR_RATE, 440.0f); 


result = FMOD_System_CreateDSPByType(system, FMOD_DSP_TYPE_OSCILLATOR, &dsp);
result = FMOD_DSP_SetParameterFloat(dsp, FMOD_DSP_OSCILLATOR_RATE, 440.0f); /* Musical note 'A' */