Changes the device that a stream, MOD music or sample is using.
BOOL BASS_ChannelSetDevice(
DWORD handle,
DWORD device
);
| handle | The channel or sample handle... a HMUSIC, HSTREAM or HSAMPLE. |
| device | The device to use... 0 = no sound, 1 = first real output device, BASS_NODEVICE = no device. |
| BASS_ERROR_HANDLE | handle is not a valid channel. |
| BASS_ERROR_DEVICE | device is invalid. |
| BASS_ERROR_INIT | The requested device has not been initialized. |
| BASS_ERROR_NOTAVAIL | Only decoding channels are allowed to use the BASS_NODEVICE option. Final output mix streams (using STREAMPROC_DEVICE) cannot be moved to another device. |
The BASS_NODEVICE option can be used to detach a decoding channel from a device, so that it does not get freed when BASS_Free is called. Note a detached channel cannot be freed asynchronously (eg. with BASS_ChannelRef) if there are no initialized devices (output or recording), and nor will the BASS_ChannelSetSync BASS_SYNC_THREAD option work, because the required threads will not be running.