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

# Dialogue Separation

> Separate speech from music and effects for dubbing, podcast editing, and post-production

Isolate dialogue from the music and effects bed in any audio or video content. Use the separated outputs for dubbing prep, podcast cleanup, broadcast post-production, or feeding clean speech into downstream AI models.

## Create a Task

This example extracts both the dialogue and the background (music + effects) stems:

<CodeGroup>
  ```python separate_dialogue.py theme={null}
  import requests

  API_KEY = "your_api_key"
  HEADERS = {"Content-Type": "application/json", "x-api-key": API_KEY}

  response = requests.post(
      "https://api.audioshake.ai/tasks",
      headers=HEADERS,
      json={
          "assetId": "your_asset_id",
          "targets": [
              {"model": "dialogue", "formats": ["wav"]},
              {"model": "music_fx", "formats": ["wav"]}
          ]
      }
  )

  task_id = response.json()["id"]
  print(f"Task created: {task_id}")
  ```

  ```javascript separateDialogue.js theme={null}
  const API_KEY = "your_api_key";
  const headers = { "Content-Type": "application/json", "x-api-key": API_KEY };

  const createRes = await fetch("https://api.audioshake.ai/tasks", {
    method: "POST",
    headers,
    body: JSON.stringify({
      assetId: "your_asset_id",
      targets: [
        { model: "dialogue", formats: ["wav"] },
        { model: "music_fx", formats: ["wav"] }
      ]
    })
  });

  const { id: taskId } = await createRes.json();
  console.log(`Task created: ${taskId}`);
  ```

  ```bash curl theme={null}
  curl -X POST "https://api.audioshake.ai/tasks" \
    -H "Content-Type: application/json" \
    -H "x-api-key: $AUDIOSHAKE_API_KEY" \
    -d '{
      "assetId": "your_asset_id",
      "targets": [
        { "model": "dialogue", "formats": ["wav"] },
        { "model": "music_fx", "formats": ["wav"] }
      ]
    }'
  ```
</CodeGroup>

[Check Task status](/check-task-status) to monitor progress and download results, or use [webhooks](/api-reference/tasks/webhooks) to be notified when each target completes.

## Outputs

| Target     | Role                                                             |
| ---------- | ---------------------------------------------------------------- |
| `dialogue` | Clean speech — use as reference or feed into translation/dubbing |
| `music_fx` | Music + effects bed — layer localized voiceover on top           |

## Use cases

* Prepare content for localization and foreign-language dubbing
* Clean up podcast audio by isolating the host's voice
* Extract clean dialogue for speech-to-text or AI training data
* Separate effects and ambience for sound design workflows

<CardGroup cols={2}>
  <Card title="Stem Separation" icon="waveform-lines" href="/separate-stems">
    Separate music into individual instruments instead.
  </Card>

  <Card title="Music Detection" icon="magnifying-glass" href="/detect-music-in-content">
    Find where music appears before separating.
  </Card>
</CardGroup>
