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

# Language selection

> Steer Dictation transcription toward one or more languages with the language_codes field.

Pass `language_codes` in the `config` part to steer transcription toward a
specific language. The field always takes a list, so use a single-element list
such as `["es"]` for monolingual audio, and several codes for multilingual or
code-switching audio.

* Accepts ISO 639-1 codes in a list: `["es"]`, or `["en", "es"]`
* Defaults to English (`en`) when omitted
* Applies to the transcript only. The rewrite in `llm_response` follows the
  language of the transcript unless your
  [`llm_instruction`](/docs/dictation/transcript-rewriting) says otherwise.

<Tabs groupId="language">
  <Tab language="python-sdk" title="Python SDK" default>
    ```python theme={null}
    import assemblyai as aai

    aai.settings.api_key = "<YOUR_API_KEY>"

    config = aai.DictationConfig(language_codes=["es"])

    result = aai.DictationTranscriber().transcribe_live("clip.wav", config)
    print(result.text)
    ```
  </Tab>

  <Tab language="python" title="Python">
    ```python theme={null}
    import json
    import requests

    config = {"language_codes": ["es"]}

    with open("clip.wav", "rb") as f:
        audio = f.read()

    response = requests.post(
        "https://dictation.assemblyai.com/v1/transcribe/live",
        headers={"Authorization": "<YOUR_API_KEY>"},
        files={
            "config": (None, json.dumps(config), "application/json"),
            "audio": ("clip.wav", audio, "audio/wav"),
        },
        timeout=90,
    )
    response.raise_for_status()
    print(response.json()["text"])
    ```
  </Tab>

  <Tab language="javascript" title="JavaScript">
    ```javascript theme={null}
    import { readFileSync } from "fs";

    const config = { language_codes: ["es"] };

    const audio = readFileSync("clip.wav");
    const form = new FormData();
    form.append(
      "config",
      new Blob([JSON.stringify(config)], { type: "application/json" })
    );
    form.append("audio", new Blob([audio], { type: "audio/wav" }), "clip.wav");

    const response = await fetch(
      "https://dictation.assemblyai.com/v1/transcribe/live",
      { method: "POST", headers: { Authorization: "<YOUR_API_KEY>" }, body: form }
    );
    console.log((await response.json()).text);
    ```
  </Tab>

  <Tab language="bash" title="cURL">
    ```bash theme={null}
    curl -X POST https://dictation.assemblyai.com/v1/transcribe/live \
      -H 'Authorization: <YOUR_API_KEY>' \
      -F 'config={"language_codes": ["es"]};type=application/json' \
      -F 'audio=@clip.wav;type=audio/wav'
    ```
  </Tab>
</Tabs>

## Multilingual audio

Pass several codes when a single clip moves between languages, which is common
in dictation from bilingual speakers:

```json theme={null}
{ "language_codes": ["en", "es"] }
```

List only the languages you actually expect. Extra codes give the model more
ways to be wrong on ambiguous audio.

## Supported languages

| Code | Language   | Code | Language   |
| ---- | ---------- | ---- | ---------- |
| `en` | English    | `da` | Danish     |
| `es` | Spanish    | `fi` | Finnish    |
| `de` | German     | `hi` | Hindi      |
| `fr` | French     | `vi` | Vietnamese |
| `it` | Italian    | `ar` | Arabic     |
| `pt` | Portuguese | `he` | Hebrew     |
| `tr` | Turkish    | `ja` | Japanese   |
| `nl` | Dutch      | `ur` | Urdu       |
| `sv` | Swedish    | `zh` | Mandarin   |
| `no` | Norwegian  |      |            |

## Related features

* [Prompting and keyterms](/docs/dictation/prompting-and-keyterms) steers the
  transcript within the chosen language.
* [Transcript rewriting](/docs/dictation/transcript-rewriting) reshapes the
  transcript after it is written.
