# How to programmatically enable or disable audio tracks on Web

This article describes how you can use the AudioTrack API, a sub-API of the MediaTrack API, to enable or disable audio tracks. Implementing this functionality is a common use-case for developers who want to build their own UI to toggle audio languages on and off.

Once you have programmatically selected a track, you can set its `enabled` property (or method) to `true` or `false`. Because only one audio track can play at a time, enabling an audio track automatically disables all other audio tracks. Note that this does not apply to text tracks: multiple text tracks can be active at the same time.

## Usage

The Web SDK exposes the audio tracks through [`player.audioTracks`](https://optiview.dolby.com/docs/theoplayer/v11/api-reference/web/classes/ChromelessPlayer#audiotracks), which contains [`MediaTrack`](https://optiview.dolby.com/docs/theoplayer/v11/api-reference/web/interfaces/MediaTrack) objects with an [`enabled`](https://optiview.dolby.com/docs/theoplayer/v11/api-reference/web/interfaces/MediaTrack#enabled) property.

```js
// enable a specific audio track
player.audioTracks[indexOfRequestedAudioTrack].enabled = true;
```

## Related articles

* [How to programmatically detect audio tracks](https://optiview.dolby.com/docs/theoplayer/how-to-guides/web/media-tracks/detect-audio-tracks.md)
* [How to programmatically detect audio track changes](https://optiview.dolby.com/docs/theoplayer/how-to-guides/web/media-tracks/detect-audio-track-changes.md)
* [How to build a chromeless UI](https://optiview.dolby.com/docs/theoplayer/how-to-guides/web/ui/build-chromeless-ui.md)
