0
0

Hi all,

I’m new to FMOD but I have some experience with sound APIs (from FMOD competitors hehehehe).

My question is about the OpenFrameworks implementation, through the [b:3hl4m2cw]ofSoundPlayer[/b:3hl4m2cw] class.

As provided, this class does not support DSP filtering.

So I created a class that extends it and overrides the play method.

My play() method is now like this:
[code:3hl4m2cw]void ofMTSoundPlayer::play()
{
// if it’s a looping sound, we should try to kill it, no?
// or else people will have orphan channels that are looping
if (bLoop == true){
FMOD_Channel_Stop(channel);
}

// if the sound is not set to multiplay, then stop the current,
// before we start another
if (!bMultiPlay){
    FMOD_Channel_Stop(channel);
}

FMOD_System_PlaySound(sys, FMOD_CHANNEL_FREE, sound, bPaused, &channel);
//FMOD_System_PlayDSP( sys, FMOD_CHANNEL_FREE, hpf1, bPaused, &channel );

FMOD_Channel_GetFrequency(channel, &internalFreq);
FMOD_Channel_SetVolume(channel,volume);
FMOD_Channel_SetPan(channel,pan);
FMOD_Channel_SetFrequency(channel, internalFreq * speed);
FMOD_Channel_SetMode(channel,  (bLoop == true) ? FMOD_LOOP_NORMAL : FMOD_LOOP_OFF);

// Create DSP
FMOD_System_CreateDSPByType( sys, FMOD_DSP_TYPE_HIGHPASS, &hpf1 );
FMOD_Channel_AddDSP( channel, hpf1, NULL );

//fmod update() should be called every frame - according to the docs.
//we have been using fmod without calling it at all which resulted in channels not being able
//to be reused.  we should have some sort of global update function but putting it here
//solves the channel bug
FMOD_System_Update(sys);

}
[/code:3hl4m2cw]

This results in a link-time error:
[code:3hl4m2cw]ofMTSoundPlayer.obj : error LNK2019: unresolved external symbol _FMOD_Channel_AddDSP@12 referenced in function "public: void __thiscall ofMTSoundPlayer::play(void)" (?play@ofMTSoundPlayer@@QAEXXZ)[/code:3hl4m2cw]

Any idea how to solve it? The call seems right, and the .lib file + the fmod.h header file are included.

  • You must to post comments
0
0

Hi funkmeisterb, welcome to the forums.

Which version of FMOD are you using?

If you’re not already, can you include the following snippet of code to make sure the lib and header versions match:

[code:2r5s8fc1] unsigned int version;
result = FMOD_System_GetVersion(system, &version);
ERRCHECK(result);

if (version < FMOD_VERSION)
{
    printf("Error!  You are using an old version of FMOD %08x.  This program requires %08x\n", version, FMOD_VERSION);
    exit(-1);
}[/code:2r5s8fc1]

-Pete

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.