FMOD Studio Lowlevel Issue


(Harsh Siloiya) #1

I’ve been trying to implement FMOD Studio Lowlevel API in a project. When the getNumDrivers function is called, I get the correct number of drivers but while calling the getDriverInfo function, I get FMOD_RESULT as – FMOD error! (30) An invalid object handle was used. Here is a sample of my code snippet :-

    result = FMOD::System_Create(&system);
FMOD_ERROR_CHECK(result);
result = system->getVersion(&version);           
FMOD_ERROR_CHECK(result);

if (version < FMOD_VERSION)
{
	LogMsg("Error!  You are using an old version of FMOD %08x.  This program requires %08x\n", version, FMOD_VERSION);
	assert(0);
	return 0;
}
result = system->getNumDrivers(&numdrivers);      
FMOD_ERROR_CHECK(result);
char temp[10];
itoa(numdrivers, temp, 10);
LogMsg(temp);

if (numdrivers == 0)
{
	result = system->setOutput(FMOD_OUTPUTTYPE_NOSOUND);
	FMOD_ERROR_CHECK(result);
}
else
{
	result = system->getDriverInfo(0, name, sizeof(name), 0, &system_rate, &speakermode, &no_channels);
	char temp[10];
	itoa(system_rate, temp, 10);
	LogMsg(temp);
	LogMsg(name);
	FMOD_ERROR_CHECK(result);
	result = system->setDriver(0);
	FMOD_ERROR_CHECK(result);
	result = system->setSoftwareFormat(system_rate, speakermode, 0);
	FMOD_ERROR_CHECK(result);
	result = system->setDSPBufferSize(1024, 10);
	FMOD_ERROR_CHECK(result);
           result = system->init(32, FMOD_INIT_NORMAL, 0);
       FMOD_ERROR_CHECK(result);

Please suggest any changes to be made so that getDriverInfo function detects the driver properly.


(Cameron Baron) #2

Are you able to use the logging libs and send the entire log file to support@fmod.com


(Harsh Siloiya) #3

Thanks for the reply! I managed to resolve the issue. It occured due to a previous version of fmod still being linked to the project. I deleted the previous fmod dll file and it worked.