API & Integration -> Quick Start

Generate a voiceover video

This example show how to auto-generate a voiceover video based on a provided text using RenderScript.

Step 1
Define the voice-over

Specify an audio element. Provide the speech text through the
source
property. Using the
provider
property, you can specify which third-party service to generate the voice-over with. In this case, we'll use Elevenlabs using the
eleven_multilingual_v2
model and the specified voice ID.
curl -X POST https://api.creatomate.com/v2/renders \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer YOUR_API_KEY_HERE" \
     -d '{
  "output_format": "mp4",
  "elements": [
    {
      "type": "audio",
      "source": "This text is read aloud!",
      "provider": "elevenlabs model_id=eleven_multilingual_v2 voice_id=XrExE9yKIg1WjnnlVkGX stability=0.75"
    }
  ]
}'

Step 2
Insert a text element to hold the captions

In case you want to add subtitles to accompanying the voiceover, define a text element. This is just a placeholder for now, in the next step, we'll attach the text element to the voiceover element.
curl -X POST https://api.creatomate.com/v2/renders \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer YOUR_API_KEY_HERE" \
     -d '{
  "output_format": "mp4",
  "elements": [
    {
      "type": "audio",
      "provider": "elevenlabs model_id=eleven_multilingual_v2 voice_id=XrExE9yKIg1WjnnlVkGX stability=0.75",
      "source": "This text is read aloud!"
    },
    {
      "type": "text",
      "width": "86.66%",
      "height": "37.71%",
      "x_alignment": "50%",
      "y_alignment": "50%",
      "fill_color": "#ffffff",
      "stroke_color": "#333333",
      "stroke_width": "1.05 vmin",
      "font_family": "Montserrat",
      "font_weight": "700",
      "font_size": "8 vmin",
      "background_x_padding": "26%",
      "background_y_padding": "7%",
      "background_border_radius": "28%",
      "text": "This is a placeholder text"
    }
  ]
}'

Step 3
Attach the text to the video element

To attach the text element to the voiceover, provide the audio element with a unique name and make the text element refer to that element using the
transcript_source
property. You can choose the subtitle effect using
transcript_effect
.
curl -X POST https://api.creatomate.com/v2/renders \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer YOUR_API_KEY_HERE" \
     -d '{
  "output_format": "mp4",
  "elements": [
    {
      "name": "Voiceover-1",
      "type": "audio",
      "provider": "elevenlabs model_id=eleven_multilingual_v2 voice_id=XrExE9yKIg1WjnnlVkGX stability=0.75",
      "source": "This text is read aloud!"
    },
    {
      "type": "text",
      "width": "86.66%",
      "height": "37.71%",
      "x_alignment": "50%",
      "y_alignment": "50%",
      "fill_color": "#ffffff",
      "stroke_color": "#333333",
      "stroke_width": "1.05 vmin",
      "font_family": "Montserrat",
      "font_weight": "700",
      "font_size": "8 vmin",
      "background_x_padding": "26%",
      "background_y_padding": "7%",
      "background_border_radius": "28%",
      "transcript_source": "Voiceover-1",
      "transcript_effect": "highlight"
    }
  ]
}'