Skip to main content

CaptureSettingsBuilder

Electron APIs / recorder / CaptureSettingsBuilder

A builder interface for constructing a complete CaptureSettings configuration.

Allows incremental addition of screen, game, and audio capture sources, as well as customization of encoder and device settings. The builder supports chaining and returns a finalized CaptureSettings object upon calling build().

See

CaptureSettings

Extends

Properties

PropertyTypeDescription
audioEncoderAudioEncoderInfoThe audio encoder selected for encoding captured audio data. See AudioEncoderInfo
audioSettingsAudioSettingsSettings related to input/output audio devices and application-specific audio capture. See AudioSettings
sourcesCaptureSource[]List of media sources to capture (e.g., display, window, or game). See CaptureSource
videoEncoderSettingsVideoEncoderSettingsBaseEncoder settings used for video compression. See VideoEncoderSettingsBase
videoSettingsVideoSettingsSettings related to video resolution, frame rate, and color configuration. See VideoSettings

Methods

addApplicationAudioCapture()

addApplicationAudioCapture(param: ApplicationAudioCaptureParams, settings?: AudioDeviceSettings): CaptureSettingsBuilder;

Adds application-specific audio capture based on process name.

Parameters

ParameterTypeDescription
paramApplicationAudioCaptureParamsApplication audio capture parameters.
settings?AudioDeviceSettingsOptional audio settings for the application.

Returns

CaptureSettingsBuilder

The builder instance for chaining.


addAudioCapture()

addAudioCapture(params: AudioDeviceParams, settings?: AudioDeviceSettings): CaptureSettingsBuilder;

Adds an audio device for capturing input or output audio.

Parameters

ParameterTypeDescription
paramsAudioDeviceParamsParameters identifying the audio device.
settings?AudioDeviceSettingsOptional audio device settings.

Returns

CaptureSettingsBuilder

The builder instance for chaining.


addAudioDefaultCapture()

addAudioDefaultCapture(
type: AudioDeviceType,
params?: DefaultAudioDeviceParams,
settings?: AudioDeviceSettings): CaptureSettingsBuilder;

Adds the default system audio device (input or output) if not already added.

Parameters

ParameterTypeDescription
typeAudioDeviceTypeThe device type (input or output).
params?DefaultAudioDeviceParamsOptional configuration for default audio capture behavior.
settings?AudioDeviceSettingsOptional audio device settings.

Returns

CaptureSettingsBuilder

The builder instance for chaining.


addGameSource()

addGameSource(settings: GameCaptureSourceSettings): CaptureSettingsBuilder;

Adds a game source to the capture settings.

Parameters

ParameterTypeDescription
settingsGameCaptureSourceSettingsThe game capture configuration.

Returns

CaptureSettingsBuilder

The builder instance for chaining.


addScreenSource()

addScreenSource(settings: MonitorCaptureSourceSettings): CaptureSettingsBuilder;

Adds a screen (monitor) source to the capture settings.

Parameters

ParameterTypeDescription
settingsMonitorCaptureSourceSettingsThe screen capture configuration.

Returns

CaptureSettingsBuilder

The builder instance for chaining.


build()

build(): CaptureSettings;

Finalizes the capture configuration and returns a CaptureSettings object.

Returns

CaptureSettings

The completed capture settings.