BASS

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_DXA sufficient version of DirectX (or ALSA) is not installed.
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.

When using the default device (device = -1), BASS_RecordGetDevice can be used to find out which device it was mapped to.

Platform-specific

Recording support requires DirectX 5 (or above) on Windows.

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_RecordGetInfo, BASS_RecordGetInput, BASS_RecordSetDevice, BASS_RecordSetInput, BASS_RecordStart