# Audio track

Audio track state and actions for the player store

Tracks available audio tracks and selects the enabled track.

## Import

```tsx
import { audioTrackFeature } from '@videojs/react';
```

The `videoFeatures` [feature bundle](https://videojs.org/docs/framework/react/guides/presets) includes this feature.

## API Reference

### State

| Property | Type | Description |
| --- | --- | --- |
| `audioTrackList` | `MediaAudioTrack[]` | Audio tracks available for manual track selection. |

### Actions

| Action | Type | Description |
| --- | --- | --- |
| `selectAudioTrack` | `(value: string) => void` | Select an audio track by menu value. |

### Selector

Pass `selectAudioTrack` to [`usePlayer`](https://videojs.org/docs/framework/react/reference/api/use-player) to subscribe to audio track state. Returns `undefined` if the audio track feature is not configured.

**AudioTrackInfo.tsx**

```tsx
import { selectAudioTrack, usePlayer } from '@videojs/react';

function AudioTrackInfo() {
  const audioTrack = usePlayer(selectAudioTrack);
  if (!audioTrack) return null;

  return <span>{audioTrack.audioTrackList.length} audio tracks</span>;
}
```

---

React documentation: https://videojs.org/docs/framework/react/llms.txt
All documentation: https://videojs.org/llms.txt
