Sets the device to use for subsequent calls in the current thread.
BOOL BASS_SetDevice( DWORD device );
|device||The device to use... 0 = no sound, 1 = first real output device.|
|BASS_ERROR_DEVICE||device is invalid.|
|BASS_ERROR_INIT||The device has not been initialized.|
The functions that use the device selection are the following: BASS_Free, BASS_GetDSoundObject, BASS_GetInfo, BASS_Start, BASS_Stop, BASS_Pause, BASS_SetVolume, BASS_GetVolume, BASS_Set3DFactors, BASS_Get3DFactors, BASS_Set3DPosition, BASS_Get3DPosition, BASS_SetEAXParameters, BASS_GetEAXParameters. It also determines which device is used by a new sample/stream/music: BASS_MusicLoad, BASS_SampleLoad, BASS_StreamCreateFile, etc.
When one of the above functions (or BASS_GetDevice) is called, BASS will check the current thread's device setting, and if no device is selected (or the selected device is not initialized), BASS will automatically select the lowest device that is initialized. This means that when using a single device, there is no need to use this function; BASS will automatically use the device that is initialized. Even if you free the device, and initialize another, BASS will automatically switch to the one that is initialized.
BASS_SetDevice(2); // select device 2 stream = BASS_StreamCreateFile(FALSE, "afile.mp3", 0, 0, 0); // create the stream