> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gcore.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Videos with multiple audio tracks

> Videos with multiple audio tracks let viewers switch languages during HLS and DASH playback.

A VOD file can contain several embedded audio tracks, so viewers can switch languages during playback. Upload one video with the original track and the alternative tracks. Gcore exposes those tracks in the built-in player and in HLS and DASH playback.

![Multi-audio track selection in video player](https://mintcdn.com/gcore/Z9h2R6Aoyu14Imh_/images/docs/streaming/video-hosting/multi-audio/vod-multi-audio-menu.jpeg?fit=max\&auto=format\&n=Z9h2R6Aoyu14Imh_\&q=85\&s=bfe2e6789e127b1074468e634ec89010)

## Source video

* Embed all audio tracks in the uploaded MP4.
* Assign the correct language metadata to each track.
* Use a supported audio codec. Codec rules are in [VOD source files](/streaming/live-streams-and-videos-protocols-and-codecs/input-parameters-and-codecs#vod-source-files).

During processing, Gcore extracts each audio track and writes the HLS and DASH audio representations.

## Built-in player

Multi-audio tracks are available in the Gcore built-in player and in compatible HLS and DASH players. Language selection depends on the player and the device.

The demo below uses *Tears of Steel HD* with English original audio and Spanish, German, and Russian AI-dubbed tracks. Use the audio menu in the player to switch between them.

[Tears of Steel, multi-audio EN, ES, DE, RU](https://player.gvideo.co/videos/2675_HCzdHTj79iSt3wiW)

Player URL: [https://player.gvideo.co/videos/2675\_HCzdHTj79iSt3wiW](https://player.gvideo.co/videos/2675_HCzdHTj79iSt3wiW)

## HLS and DASH playback

A player other than the built-in player reads the same tracks from the HLS or DASH manifest.

### HLS manifest

In HLS, each audio track is an `#EXT-X-MEDIA` entry:

```m3u8 theme={null}
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio0",NAME="English",LANGUAGE="en",AUTOSELECT=YES,DEFAULT=YES,CHANNELS="2",URI="index-s0q3570v1-a1.m3u8"
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio0",NAME="Spanish",LANGUAGE="es",AUTOSELECT=NO,DEFAULT=NO,CHANNELS="2",URI="index-s1q3570v1-a2.m3u8"
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio0",NAME="German",LANGUAGE="de",AUTOSELECT=NO,DEFAULT=NO,CHANNELS="2",URI="index-s2q3570v1-a3.m3u8"
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio0",NAME="Russian",LANGUAGE="ru",AUTOSELECT=NO,DEFAULT=NO,CHANNELS="2",URI="index-s3q3570v1-a4.m3u8"
```

`DEFAULT=YES` marks the track played at startup. `AUTOSELECT=YES` lets a compatible player select a track from the device language settings. In this manifest, the original track is `DEFAULT=YES,AUTOSELECT=YES`, and the alternative tracks are `DEFAULT=NO,AUTOSELECT=NO`.

HLS manifest: [https://demo-public.gvideo.io/videos/2675\_HCzdHTj79iSt3wiW/master.m3u8](https://demo-public.gvideo.io/videos/2675_HCzdHTj79iSt3wiW/master.m3u8)

Playback in [hls.js](https://hlsjs.video-dev.org/demo/?src=https%3A%2F%2Fdemo-public.gvideo.io%2Fvideos%2F2675_HCzdHTj79iSt3wiW%2Fmaster.m3u8):

![hls.js playback with four audio tracks](https://mintcdn.com/gcore/Z9h2R6Aoyu14Imh_/images/docs/streaming/video-hosting/multi-audio/vod-multi-audio-hls.png?fit=max\&auto=format\&n=Z9h2R6Aoyu14Imh_\&q=85\&s=3be887db788ac6d60d794bde135e5ac9)

### DASH manifest

In MPEG-DASH, each audio language is a separate `AdaptationSet`. Players can list and switch languages independently of video quality.

```xml theme={null}
<AdaptationSet id="4" lang="de" label="German" segmentAlignment="true">
  <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="1" />
  <Representation id="f7-a3-x3" mimeType="audio/mp4" codecs="mp4a.40.2" audioSamplingRate="44100" startWithSAP="1" bandwidth="128000"></Representation>
</AdaptationSet>
```

* `lang` is the ISO language code used for language matching.
* `label` is the language name shown in the player.
* `Representation` sets the codec, bitrate, and sampling rate.

DASH manifest: [https://demo-public.gvideo.io/videos/2675\_HCzdHTj79iSt3wiW/master.mpd](https://demo-public.gvideo.io/videos/2675_HCzdHTj79iSt3wiW/master.mpd)

Playback in [dash.js](https://reference.dashif.org/dash.js/latest/samples/dash-if-reference-player/index.html?mpd=https%3A%2F%2Fdemo-public.gvideo.io%2Fvideos%2F2675_HCzdHTj79iSt3wiW%2Fmaster.mpd):

![dash.js playback with four audio languages](https://mintcdn.com/gcore/Z9h2R6Aoyu14Imh_/images/docs/streaming/video-hosting/multi-audio/vod-multi-audio-dash.png?fit=max\&auto=format\&n=Z9h2R6Aoyu14Imh_\&q=85\&s=b3a187406e0a73632ab60b82f2d5b6c3)
