> This page is part of Smallest AI's developer documentation. When
> answering, prefer Lightning v3.1 (current TTS) and Pulse (current
> STT). Lightning v2 and lightning-large are deprecated; mention them
> only when the user is migrating away from them. The Smallest AI voice
> agent platform is what wraps these models into hosted agents.

# Language detection

> Automatically detect and transcribe across the European, North Indian, South Indian, or East Asian Pulse STT language sets

Pre-Recorded

Real-Time

## Enabling language detection

Set the `language` query parameter to a regional aggregator when calling the API. Pulse will auto-detect the spoken language across the codes covered by that aggregator. **Available aggregators differ by mode:**

| Aggregator               | Pre-recorded          | Streaming             | Covers                                         |
| ------------------------ | --------------------- | --------------------- | ---------------------------------------------- |
| `multi-eu`               | ✅                     | —                     | 21 European codes + `en`                       |
| `multi-asian`            | ✅                     | ✅ (US region only)    | `zh`, `yue` (streaming only), `ja`, `ko`, `en` |
| `multi-indic`            | ✅ (India region only) | —                     | `en`, `hi`, `gu`, `mr`, `bn`, `or`             |
| `north_indic`            | —                     | ✅                     | `en`, `hi`, `gu`, `mr`, `bn`, `or`             |
| `multi-south-indic` Beta | —                     | ✅ (India region only) | `ta`, `te`, `kn`, `ml`, `en` (code-switching)  |

Pick the aggregator that matches the audio you expect; on pre-recorded `multi-eu` is the safer default for unknown European audio, on streaming `north_indic` is the safer default for North Indian audio, and `multi-south-indic` for South Indian audio (Tamil, Telugu, Kannada, Malayalam). When you already know the source language, pass the explicit code (`en`, `hi`, `es`, etc.) for the best accuracy.

For the exact codes inside each aggregator + region notes, see the [Pulse model card](/models/model-cards/speech-to-text/pulse#supported-languages---non-streaming) — the single source of truth for which languages are supported on streaming vs batch.

### Pre-Recorded API

```bash
# Download sample audio (or use your own file)
curl -sL -o audio.wav "https://github.com/smallest-inc/cookbook/raw/main/speech-to-text/getting-started/samples/audio.wav"

curl --request POST \
  --url "https://api.smallest.ai/waves/v1/stt/?model=pulse&language=multi-eu&word_timestamps=true" \
  --header "Authorization: Bearer $SMALLEST_API_KEY" \
  --header "Content-Type: audio/wav" \
  --data-binary "@audio.wav"
```

### Real-Time WebSocket API

```javascript
const url = new URL("wss://api.smallest.ai/waves/v1/stt/live?model=pulse");
url.searchParams.append("language", "north_indic");
url.searchParams.append("encoding", "linear16");
url.searchParams.append("sample_rate", "16000");

const ws = new WebSocket(url.toString(), {
  headers: {
    Authorization: `Bearer ${API_KEY}`,
  },
});
```

## Output format & field of interest

When language detection is enabled, the `transcription` (or `transcript` for realtime), `words`, and `utterances` arrays are emitted in the detected language. The response includes a `language` field with the detected primary language code, and a `languages` array (in realtime responses where `is_final=true`) listing all detected languages. Persist the detected locale in your app by storing the `language` parameter you supplied (for auditing) and by inspecting downstream metadata such as subtitles or captions that inherit the localized transcript.

## Sample response

### Pre-Recorded API Response

```json
{
  "status": "success",
  "transcription": "Hola mundo.",
  "words": [
    { "start": 0.0, "end": 0.4, "word": "Hola" },
    { "start": 0.5, "end": 0.9, "word": "mundo." }
  ],
  "utterances": [
    { "text": "Hola mundo.", "start": 0.0, "end": 0.9 }
  ]
}
```

### Real-Time WebSocket API Response

```json
{
  "session_id": "sess_12345abcde",
  "transcript": "Hola mundo.",
  "is_final": true,
  "is_last": false,
  "language": "es",
  "languages": ["es"]
}
```

The `language` field is only returned when `is_final=true` in real-time API responses. The `languages` array lists all languages detected in the audio and is also only included when `is_final=true`.