Firelight Technologies FMOD Studio API
System::setDriver
Selects a soundcard driver. This function is used when an output mode has enumerated more than one output device, and you need to select between them.
C++ Syntax
FMOD_RESULT System::setDriver(
int driver
);
C Syntax
FMOD_RESULT FMOD_System_SetDriver(
FMOD_SYSTEM *system,
int driver
);
C# Syntax
RESULT System.setDriver(
int driver
);
JavaScript Syntax
System.setDriver(
driver
);
Parameters
- driver
- Driver number to select. 0 = primary or main sound device as selected by the operating system settings. Use System::getNumDrivers and System::getDriverInfo to determine available devices.
Return Values
If the function succeeds then the return value is FMOD_OK.
If the function fails then the return value will be one of the values defined in the FMOD_RESULT enumeration.
Remarks
If this function is called after FMOD is already initialized with System::init, the current driver will be shutdown and the newly selected driver will be initialized / started.
The driver that you wish to change to must support the current output format, sample rate, and number of channels. If it does not, FMOD_ERR_OUTPUT_INIT is returned and driver state is cleared. You should now call System::setDriver with your original driver index to restore driver state (providing that driver is still available / connected) or make another selection.
See Also
- System::getDriver
- System::getNumDrivers
- System::getDriverInfo
- System::setOutput
- System::init
- System::close
Version 1.10.03 Built on Feb 1, 2018