# Audio Transcription

> Convert speech to text with Whisper.

**URL:** https://inference.sh/docs/examples/audio-transcription
**Last updated:** 2026-09-18

---

Convert speech to text with Whisper.

---

## Using the Grid

1. Go to [Apps](https://inference.sh/apps)
2. Find `whisper`
3. Upload an audio file
4. Click **Run**

Supported formats: MP3, WAV, M4A, FLAC, OGG

---

## With Python SDK

```python
from inferencesh import inference

client = inference(api_key="inf_your_key")

result = client.run({
    "app": "infsh/whisper",
    "input": {
        "audio": "/path/to/audio.mp3"  # Uploaded automatically
    }
})

print(result["output"]["text"])
```

---

## With Timestamps

Get word-level or segment-level timestamps:

```python
result = client.run({
    "app": "infsh/whisper",
    "input": {
        "audio": "/path/to/audio.mp3",
        "timestamps": "word"  # or "segment"
    }
})

for segment in result["output"]["segments"]:
    print(f"[{segment['start']:.1f}s] {segment['text']}")
```

Output:
```
[0.0s] Welcome to today's episode.
[2.1s] We're going to discuss AI agents.
[4.5s] Let's get started.
```

---

## With Translation

Translate audio to English:

```python
result = client.run({
    "app": "infsh/whisper",
    "input": {
        "audio": "/path/to/french_audio.mp3",
        "task": "translate"  # Translates to English
    }
})
```

---

## With Agent

Create an agent with `whisper` as a tool:

```
You: Transcribe this podcast episode

Agent: I'll transcribe that audio for you.
       [Calling whisper...]
       
       Here's the transcription:
       
       "Welcome to the AI Weekly podcast. Today we're 
       discussing the latest developments in generative AI..."
       
       The full transcription is 2,450 words. Would you like
       me to summarize it?
```

---

```

---

## Model Selection

Use **setup parameters** to choose a specific Whisper model size:

```python
client.run({
    "app": "infsh/whisper",
    "setup": {
        "model_size": "large-v3"  # tiny, base, small, medium, large, large-v3
    },
    "input": { ... }
})
```

---

## Options

| Option | Values | Description |
|--------|--------|-------------|
| `task` | `transcribe`, `translate` | Transcribe or translate to English |
| `language` | `en`, `es`, `fr`, etc. | Force language detection |
| `timestamps` | `none`, `segment`, `word` | Timestamp granularity |

---

## Tips

**For better accuracy:**
- Use high-quality audio
- Remove background noise if possible
- Specify language if known

**For long files:**
- Whisper handles files up to ~2 hours
- Very long files are automatically chunked

---

## Next

→ [Content Pipeline](./content-pipeline)
