BASS_RecordInit

Initializes a recording device.

BOOL BASS_RecordInit(
    int device
);

Parameters

deviceThe device to use... -1 = default device, 0 = first. BASS_RecordGetDeviceInfo can be used to enumerate the available devices.

Return value

If successful, TRUE is returned, else FALSE is returned. Use BASS_ErrorGetCode to get the error code.

Error codes

BASS_ERROR_DEVICEdevice is invalid.
BASS_ERROR_ALREADYThe device has already been initialized. BASS_RecordFree must be called before it can be initialized again.
BASS_ERROR_DRIVERThere is no available device driver.

Remarks

This function must be successfully called before using the recording features.

Simultaneously using multiple devices is supported in the BASS API via a context switching system; instead of there being an extra "device" parameter in the function calls, the device to be used is set prior to calling the functions. BASS_RecordSetDevice is used to switch the current recording device. When successful, BASS_RecordInit automatically sets the current thread's device to the one that was just initialized.

The default device (device = -1) always maps to the "Default" device unless that has been disabled via the BASS_CONFIG_REC_DEFAULT config option. BASS_RecordGetDevice can be used afterwards to confirm which device is being used.

Platform-specific

On Windows, WASAPI or DirectSound may be used, depending on the BASS_CONFIG_REC_WASAPI config option setting.

On Linux, a "Default" device is hardcoded to device number 0, which uses the default input set in the ALSA config; that could map directly to one of the other devices or it could use ALSA plugins.

See also

BASS_RecordFree, BASS_RecordGetDeviceInfo, BASS_RecordGetInfo, BASS_RecordGetInput, BASS_RecordSetDevice, BASS_RecordSetInput, BASS_RecordStart