0
0

Hello!

I have looked through the FMOD Ex examples and tried to implement a simple car sound (just for learning).
Therefore I have 5 sounds, each for a certain rpm-range. When the rpm goes above a certain value, the next sound is started and the old one is paused. The starting of a new sound works, but I don’t get the old ones pausing so the old and new sounds are played back.

Here is a code snipped:
[code:6qiog8u3]
FMOD::Sound* CSoundManager::AddSound(const char* pFilename, bool loop)
{
FMOD::Sound* sound1;
m_result = m_system->createSound(pFilename, FMOD_HARDWARE, 0, &sound1);
if (!ERRCHECK(m_result)) return 0;

if (loop) sound1->setMode(FMOD_LOOP_NORMAL);
m_sounds.push_back(sound1);

return sound1;

}

// Start a sound
CSoundManager::PlaySound(m_sounds[0],false,m_pSoundChannel);

// Stop a sound
CSoundManager::PlaySound(m_sounds[0],true,m_pSoundChannel);
m_pSoundChannel->stop();
m_pSoundChannel->setVolume(0);
m_pSoundChannel->setPaused(true);
[/code:6qiog8u3]

[EDIT]: I get an error 33 (“Invalid sound handle”) for “m_pSoundChannel”.

Thank you,

  • You must to post comments
0
0

already got my error.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.