0
0

I’ve made a C++ wrapper for FMOD’s recording features but it seems that FMOD doesn’t kill all its threads when FSOUND_Close() is called in DX mode. In WinMM mode, however, all threads are killed.

These is my init & shutdown functions for FMOD:
[code:380jzlua]
BOOL FMODule::Initialize()
{
if(!FSOUND_SetOutput(m_nSoundOutputType))
return FALSE;

if(!FSOUND_SetDriver(m_nOutputDriver))
    return FALSE;

if (!FSOUND_Init(m_nFrequency, m_nOutputChannels, FSOUND_INIT_GLOBALFOCUS))
    return FALSE;

if(!FSOUND_Record_SetDriver(m_nInputDriver))
    return FALSE;

//create sample for recording
m_nRecordSamplesCount = m_nSampleCount*(RECORD_BUFFERTIME/RECORD_CALLBACKDELAY);
m_recordSample = FSOUND_Sample_Alloc(FSOUND_FREE , m_nRecordSamplesCount, FSOUND_MONO | FSOUND_16BITS , m_nFrequency, 255, 128, 255);

return TRUE;

}

void FMODule::Shutdown()
{
FSOUND_Sample_Free(m_recordSample);
m_recordSample = NULL;

FSOUND_Close();
TRACE("FMOD has shut down\n");

}
[/code:380jzlua]

I start and stop the FMOD sound system several times during program execution and everytime I stop one more thread remains active. Again this is only in DirectX mode and not WinMM. Shouldn’t FSOUND_Close() cleanup all its threads?

  • You must to post comments
0
0

yup, runs perfectly now. Thanx

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.