Skip to main content

AudioTracks

Electron APIs / recorder / AudioTracks

type AudioTracks = 0 | 1 | 2 | 4 | 8 | 16 | 32 | 255 | number;

Audio track selection flags.

Each value corresponds to a specific audio track using a bitmask format. You can combine tracks using bitwise OR operations. For example, Track1 | Track2 is 3.

ValueDescription
0No audio track selected.
1Select audio Track 1.
2Select audio Track 2.
4Select audio Track 3.
8Select audio Track 4.
16Select audio Track 5.
32Select audio Track 6.
0xffSelect all available tracks (bitmask 0xff).
numberAny custom or combined track.

Remarks

  • This format is useful when routing or encoding specific audio channels.
  • The number type is included to allow for custom or combined values not explicitly listed.

Example

const tracks: AudioTracks = 1 | 2; // Track1 and Track2