Fmod Studio API - How to play in a specific soundcard


(Marcelo Manzo) #1

Hello,

I’m very familiar with the fmodex and know how the setdriver works.
I’ve started a new project using the studio api, and I can’t get the api to play sounds in a soundcard that is not the default.

Using ObjectPan.cpp

FMOD::Studio::System *system = NULL;
ERRCHECK( FMOD::Studio::System::create(&system) );

FMOD::System* lowLevelSystem = NULL;
ERRCHECK( lowLevelSystem->setDriver(1) );

The line above looks like it’s ignored and the sound is always playing in the default soundcard.

I’m using the latest version of studio dll.


(Marcelo Manzo) #2

I did some more research, and it seems related to the sound_output

If I comment:
FMOD_RESULT result = lowLevelSystem->setOutput(FMOD_OUTPUTTYPE_AUDIO3D);

It plays fine in the driver 1,

but if the output it’s AUDIO3D, does not matter what I do, it will play in the default soundcard driver = 0


(Cameron Baron) #3

What you will want to do is use System::getNumDrivers and iterate over the drivers, using System::getDriverInfo to determine the driver you are looking for. Then use setDriver with the index of the driver you want to use.

https://fmod.com/resources/documentation-api?page=content/generated/FMOD_System_GetDriverInfo.html


(Marcelo Manzo) #4

Yes, I know, I’m just hard coding 1
ERRCHECK( lowLevelSystem->setDriver(1) );
to see if works.