Video

Render a voiceover from a script

Renders a script to a voiceover audio track via text-to-speech, returning an audioId to pass to a video's voice.audioId (which also drives synced subtitles). Costs 1 credit. Text limit is 1000 characters.

post/api/generate_voice

Request

  • Base URL: https://app.pedra.ai
  • URL: https://app.pedra.ai/api/generate_voice
  • Auth: none required

Request body

apiKeystring required

Account API key, sent in the request body. Get one at https://app.pedra.ai under Settings → API.

textstring required

The script to narrate.

languagestring

Voice language (selects the speaker). See /api/music_library for accepted values.

Response

Voiceover rendered.

messagestring
audioIdstring

Pass to a video's voice.audioId to attach the narration.

audioUrlstring

Public URL of the rendered mp3.

alignmentUrlstring

URL of the word-alignment JSON used for synced subtitles.

durationinteger

Approximate duration in seconds.

Example response

{
  "message": "Voice generated successfully"
}

Changes

No recorded changes to this operation across all 1 revision of this API.