> **Experimental**
>
> `@aws-cdk/aws-medialive-alpha` is an [**experimental**](/stability) (alpha) package: its API may change in any release, without a major version bump.
# AudioSelector

An audio selector that identifies which audio to extract from the input.

- Stability: [Experimental](/cdk/api/stability.html)
- Source: [`lib/audio-selector.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0-alpha.0/packages/@aws-cdk/aws-medialive-alpha/lib/audio-selector.ts#L182)

## Example

```ts
declare const stack: Stack;
declare const input: medialive.IInput;
declare const bucket: s3.IBucket;
declare const video: medialive.EncodeConfiguration;

new medialive.Channel(stack, 'Channel', {
  inputs: [{
    input,
    audioSelectors: [
      medialive.AudioSelector.byLanguage('eng', 'eng', medialive.AudioLanguageSelectionPolicy.STRICT),
    ],
    captionSelectors: [
      medialive.CaptionSelector.embedded('embedded'),
    ],
    videoSelector: {
      colorSpace: medialive.VideoColorSpace.HDR10,
      colorSpaceUsage: medialive.VideoColorSpaceUsage.FORCE,
      selectBy: medialive.VideoSelection.byProgramId(1),
    },
  }],
  outputGroups: [
    medialive.OutputGroupConfiguration.hls({
      name: 'hls',
      destinations: [medialive.OutputDestination.toBucket(bucket, 'live/stream')],
      outputs: [{ encodes: [video], outputName: 'hls_out' }],
    }),
  ],
});
```

## Properties

- `name`: string — The name of this audio selector.

  Reference it from features that monitor a specific
  selector, such as an audio-silence {@link FailoverCondition }.

## Methods

- `byLanguage(name: string, languageCode: string, languageSelectionPolicy?: AudioLanguageSelectionPolicy): AudioSelector // chainable` (static) — Select audio by language code.

  **Parameters**

  - `name` — a name for this selector.
  - `languageCode` — the three-letter (ISO 639-2) language code to select.
  - `languageSelectionPolicy` — how strictly to identify the stream by language on a PMT update.

- `byPid(name: string, pids: AudioPidConfig[]): AudioSelector // chainable` (static) — Select one or more audio PIDs from the source.

  **Parameters**

  - `name` — a name for this selector.
  - `pids` — the PID configurations (each with optional Dolby E decode and pre-mix settings).

- `byTrack(name: string, tracks: AudioTrackConfig[], dolbyEProgramSelection?: DolbyEProgramSelection): AudioSelector // chainable` (static) — Select one or more audio tracks (1-based) from the source.

  **Parameters**

  - `name` — a name for this selector.
  - `tracks` — the track configurations (each with optional pre-mix settings).
  - `dolbyEProgramSelection` — which Dolby E program to decode from the selected track(s).

- `default(name: string): AudioSelector // chainable` (static) — Select the default audio track (no specific selector settings).

- `hlsRendition(name: string, options: HlsRenditionSelectionOptions): AudioSelector // chainable` (static) — Select an HLS audio rendition by its `#EXT-X-MEDIA` `GROUP-ID` and `NAME`.

  **Parameters**

  - `name` — a name for this selector.
  - `options` — the target rendition's group id and name.
