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

# Dubb Runway-lyd

> Oversett talt lyd til et målspråk med Runway API.

Bruk `POST /runwayml/v1/voice_dubbing` til å oversette talt lyd til et annet
språk. Bruk modell-ID-en `eleven_voice_dubbing`.
Send CometAPI API-nøkkelen med Bearer-autentisering og en JSON-forespørselstekst.

## Oppgi lyd og et målspråk

Angi `audioUri` til en tilgjengelig HTTPS-URL for kildelyden din.
Angi `targetLang` til språkkoden for målspråket, for eksempel `es` for spansk
eller `fr` for fransk. Velg den støttede koden fra forespørselsskjemaet.

Forespørselen krever `model`, `audioUri` og `targetLang`.
Erstatt eksempel-URL-en for lyd med kildefilen din.

## Konfigurer dubbing

| Felt                  | Handling                                                                                              |
| --------------------- | ----------------------------------------------------------------------------------------------------- |
| `disableVoiceCloning` | Angi `true` for å bruke en generisk stemme i stedet for å klone kildestemmen.                         |
| `dropBackgroundAudio` | Angi `true` for å fjerne bakgrunnslyd fra den dubbede utdataen.                                       |
| `numSpeakers`         | Oppgi et positivt heltall for antallet talere i kilden, eller utelat det for automatisk registrering. |

Utelat de boolske kontrollene for å bruke modellstandardene. Å sende `false` bruker også
standardene.

## Hent resultatet

Lagre den returnerte `id`, og bruk [Hent en Runway-oppgave](./runway-to-get-task-details)
for å hente oppgavestatus. Når `status` er `SUCCEEDED`, les lyd-URL-ene i
`output`. Hvis oppgaven mislykkes, undersøk `failure` og `failureCode`.


## OpenAPI

````yaml api/openapi/video/runway/official-format/post-dub-audio.openapi.json POST /runwayml/v1/voice_dubbing
openapi: 3.1.0
info:
  title: Dub Runway audio API
  version: 1.0.0
  description: Translate spoken audio into a target language with the Runway API.
servers:
  - url: https://api.cometapi.com
security:
  - bearerAuth: []
paths:
  /runwayml/v1/voice_dubbing:
    post:
      summary: Dub Runway audio
      description: >-
        Translate spoken audio into a target language with the Runway API. Save
        the returned id and retrieve the task to obtain its output.
      operationId: runway_voice_dubbing
      requestBody:
        required: true
        content:
          application/json:
            schema:
              title: eleven_voice_dubbing
              type: object
              properties:
                model:
                  type: string
                  const: eleven_voice_dubbing
                  enum:
                    - eleven_voice_dubbing
                  description: Model ID for this request.
                audioUri:
                  description: Audio input as an accessible HTTPS URL or base64 data URI.
                  anyOf:
                    - description: Accessible HTTPS URL of the audio file.
                      type: string
                      minLength: 13
                      maxLength: 2048
                      pattern: ^https:\/\/.*
                    - description: Base64 audio data URI, up to 5 MB.
                      type: string
                      minLength: 13
                      maxLength: 5242880
                      pattern: ^data:audio\/.*
                targetLang:
                  description: >-
                    The target language code to dub the audio to (e.g., "es" for
                    Spanish, "fr" for French).
                  type: string
                  enum:
                    - en
                    - hi
                    - pt
                    - zh
                    - es
                    - fr
                    - de
                    - ja
                    - ar
                    - ru
                    - ko
                    - id
                    - it
                    - nl
                    - tr
                    - pl
                    - sv
                    - fil
                    - ms
                    - ro
                    - uk
                    - el
                    - cs
                    - da
                    - fi
                    - bg
                    - hr
                    - sk
                    - ta
                disableVoiceCloning:
                  description: >-
                    Set true to use a generic voice instead of cloning the
                    source voice. Omit or use false for the model default.
                  type: boolean
                dropBackgroundAudio:
                  description: >-
                    Set true to remove background audio from the dubbed output.
                    Omit or use false for the model default.
                  type: boolean
                numSpeakers:
                  description: >-
                    Number of speakers in the source audio. Supply a positive
                    integer or omit it for automatic detection.
                  type: integer
                  exclusiveMinimum: 0
                  maximum: 9007199254740991
              required:
                - audioUri
                - targetLang
                - model
              additionalProperties: false
              description: Request settings for eleven_voice_dubbing.
              default:
                model: eleven_voice_dubbing
                audioUri: https://your-audio-host/source-speech.mp3
                targetLang: es
            examples:
              eleven_voice_dubbing:
                summary: eleven_voice_dubbing
                value:
                  model: eleven_voice_dubbing
                  audioUri: https://your-audio-host/source-speech.mp3
                  targetLang: es
      responses:
        '200':
          description: Task created. Save the returned id to retrieve task status.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: Task ID for GET /runwayml/v1/tasks/{id}.
                  status:
                    type: string
                    description: Task state, when returned.
                  createdAt:
                    type: string
                    description: Task submission timestamp, when returned.
                    format: date-time
                  output:
                    type: array
                    description: Result URLs, when returned.
                    items:
                      type: string
                      format: uri
                  failure:
                    type: string
                    description: Failure explanation, when returned.
                  failureCode:
                    type: string
                    description: Machine-readable failure code, when returned.
                  estimatedCost:
                    type: object
                    description: Task estimate metadata, when returned.
                    properties:
                      credits:
                        type: integer
                        description: Credit value reported with the task.
                    required:
                      - credits
                    additionalProperties: false
                  cost:
                    type: object
                    description: Task cost metadata, when returned.
                    properties:
                      credits:
                        type: integer
                        description: Credit value reported with the task.
                    required:
                      - credits
                    additionalProperties: false
                required:
                  - id
                additionalProperties: false
              example:
                id: 123e4567-e89b-42d3-a456-426614174000
        '400':
          description: Invalid request or unavailable task ID.
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    description: Task request error.
                    properties:
                      code:
                        type:
                          - string
                          - integer
                        description: Machine-readable task error code.
                      message:
                        type: string
                        description: Error explanation.
                      data:
                        description: Additional error details, when returned.
                    required:
                      - code
                      - message
                    additionalProperties: true
                  - type: object
                    description: Request authentication or validation error.
                    properties:
                      error:
                        type: object
                        description: Error details.
                        properties:
                          message:
                            type: string
                            description: Error explanation.
                          type:
                            type: string
                            description: Error category.
                          code:
                            type:
                              - string
                              - integer
                              - 'null'
                            description: Error code, when returned.
                        required:
                          - message
                        additionalProperties: true
                    required:
                      - error
                    additionalProperties: true
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                type: object
                description: Request authentication or validation error.
                properties:
                  error:
                    type: object
                    description: Error details.
                    properties:
                      message:
                        type: string
                        description: Error explanation.
                      type:
                        type: string
                        description: Error category.
                      code:
                        type:
                          - string
                          - integer
                          - 'null'
                        description: Error code, when returned.
                    required:
                      - message
                    additionalProperties: true
                required:
                  - error
                additionalProperties: true
      x-codeSamples:
        - lang: Shell
          label: eleven_voice_dubbing
          source: |
            curl https://api.cometapi.com/runwayml/v1/voice_dubbing \
              --request POST \
              --header "Authorization: Bearer $COMETAPI_KEY" \
              --header "Content-Type: application/json" \
              --data '{
              "model": "eleven_voice_dubbing",
              "audioUri": "https://your-audio-host/source-speech.mp3",
              "targetLang": "es"
            }'
        - lang: Python
          label: eleven_voice_dubbing
          source: |
            import os
            import requests

            payload = {   'model': 'eleven_voice_dubbing',
                'audioUri': 'https://your-audio-host/source-speech.mp3',
                'targetLang': 'es'}

            response = requests.post(
                "https://api.cometapi.com/runwayml/v1/voice_dubbing",
                headers={"Authorization": "Bearer " + os.environ["COMETAPI_KEY"]},
                json=payload,
            )
            response.raise_for_status()
            print(response.json()["id"])
        - lang: JavaScript
          label: eleven_voice_dubbing
          source: |
            const payload = {
              "model": "eleven_voice_dubbing",
              "audioUri": "https://your-audio-host/source-speech.mp3",
              "targetLang": "es"
            };

            const response = await fetch(
              "https://api.cometapi.com/runwayml/v1/voice_dubbing",
              {
                method: "POST",
                headers: {
                  Authorization: `Bearer ${process.env.COMETAPI_KEY}`,
                  "Content-Type": "application/json",
                },
                body: JSON.stringify(payload),
              },
            );
            if (!response.ok) throw new Error(await response.text());
            const task = await response.json();
            console.log(task.id);
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Use your CometAPI API key.

````