Training content goes stale faster than anyone can reshoot it. A policy changes, a product screen moves, a compliance rule gets a new clause, and suddenly a polished course has one wrong sentence in module four. Re-booking the instructor, the studio and the editor for a 20-second fix is why so many internal courses end up as slide decks with a voiceover nobody finishes.
AI avatars change the economics: the instructor records once, and every lesson after that is a script. This guide covers how to build that into an L&D or training platform, with the details that matter for courses specifically: consistency over months, partial re-renders, captions, languages and cost per course.
Why avatars fit training better than most use cases
Training video has a few properties that suit avatar generation well:
- Content is scripted anyway. Instructional designers already write scripts and get them reviewed. The avatar turns that approved text directly into video.
- Updates are small and frequent. Most changes touch one lesson, not the whole course.
- The presenter matters. Learners respond to a familiar face: their own trainer, a team lead, the head of compliance. A real person they recognize carries more authority than a stock presenter.
- Volume is predictable. Courses have known lengths, which makes cost easy to forecast.
The last point about recognizable presenters is also why quality matters. If the CFO is presenting the expense policy, the video needs to look like the CFO, not a smoothed approximation. PitchTwin builds each avatar from a real video of the person and keeps that footage, so the result looks 1:1 like them, with their own skin, hair, lighting and expressions.
Designing the feature
One instructor, one clip
The instructor records a 10 to 120 second clip in the setting you want for the whole course: same background, same clothing, same light. If they want a second look (for example, a casual one for onboarding and a formal one for compliance), record a second clip and create a second avatar.
Voice is cloned from the clip if it has at least 10 seconds of speech. For long-form training, where learners listen for many minutes, a separate 1 to 2 minute voice sample gives the best clone and is worth the extra minute of recording. Pass it as voice_url when creating the avatar.
Consistency across a course's lifetime
A course built in January and patched in September should not have a presenter who looks slightly different in the patched lesson. Every PitchTwin avatar is pinned to its engine version, with no silent upgrades, so the face does not drift between renders months apart. Input is also normalized on the way in (rotation, HEVC to H.264, long side up to 1920 px, 25 fps), so a clip recorded on a phone and one recorded on a webcam end up in the same output format.
Lessons as segments
Do not render a 20-minute course as a single video. Split it into lessons of one to three minutes, each its own generation. This keeps you well inside the limits (text up to 5,000 characters, up to 200 segments and 50 pauses per request) and means a fix to one lesson re-renders only that lesson.
Use script mode so pacing is explicit. In training, pauses do real work: they give learners a beat after a definition or before a key rule. Each pause can be up to 10 seconds, which also leaves room for an on-screen graphic you add in post. Pacing techniques are covered in writing scripts for AI avatars.
Re-render only what changed
The core trick for an L&D platform is content hashing. Hash each lesson's script and voice settings; if the hash matches the last successful render, reuse the existing video. Otherwise, generate a new one.
import hashlib
import json
import os
import requests
API = "https://pitchtwin.ai/api/v1"
HEADERS = {
"Authorization": f"Bearer {os.environ['PITCHTWIN_API_KEY']}",
"Content-Type": "application/json",
}
def lesson_hash(avatar_id, script, voice):
blob = json.dumps({"a": avatar_id, "s": script, "v": voice}, sort_keys=True)
return hashlib.sha256(blob.encode()).hexdigest()
def render_lesson(db, lesson):
voice = {"speed": 0.95, "language": lesson["language"]}
h = lesson_hash(lesson["avatar_id"], lesson["script"], voice)
existing = db.find_render(lesson["id"], h)
if existing and existing["status"] == "succeeded":
return existing # unchanged: reuse the stored video
r = requests.post(f"{API}/generations", headers=HEADERS, json={
"avatar_id": lesson["avatar_id"],
"script": lesson["script"], # [{ "text": ..., "pause_after_ms": ... }]
"voice": voice,
"webhook_url": "https://lms.example.com/hooks/pitchtwin",
})
r.raise_for_status()
gen = r.json() # { "id": ..., "status": "queued" }
return db.save_render(lesson["id"], h, gen["id"], "queued")
When the webhook arrives with generation.succeeded, verify the PitchTwin-Signature header, copy the MP4 into your own storage (generated links are signed and expire after 24 hours), and mark the render as succeeded. Webhooks are delivered once, so a periodic job should poll GET /generations/:id for any render still queued. If a render fails, the tokens are refunded automatically and your hash check will simply retry it next time.
This pattern also gives you a free audit trail: every published lesson maps to an exact script, voice setting and generation ID, which compliance teams appreciate.
Captions and accessibility
Captions are a baseline expectation for training content, and WCAG 2.1 success criterion 1.2.2 calls for captions on prerecorded video with audio. Every generation returns words with word-level timings for the final soundtrack, so you can produce accurate WebVTT captions without running speech recognition. The method is in captions from word timestamps.
The same timings are useful beyond captions: interactive transcripts where learners click a sentence to jump to it, and search across a course library by spoken content.
Multiple languages
Global teams need the same course in several languages. There are two ways to do it:
- Text mode with a language code. Translate the script, set
voice.languageto an ISO 639-1 code such asdeores, and PitchTwin speaks it in the instructor's cloned voice. - Audio mode with your own track. If you already work with a dubbing provider or professional voice talent, send the finished audio (up to 10 minutes) and the avatar is rendered to match it.
Keep one generation per language per lesson, and include the language in your content hash. More on the trade-offs on the multilingual avatar video page.
What a course costs
PitchTwin charges prepaid tokens that never expire: 1.5 tokens per second when PitchTwin voices the script, 1 token per second with your own audio. A worked example for a 10-minute course voiced by PitchTwin:
| Item | Tokens | Cost on Growth ($39 / 3,000) |
|---|---|---|
| Full course, 600 s | 900 | $11.70 |
| Same course in 2 more languages | 1,800 | $23.40 |
| Fixing one 90 s lesson | 135 | $1.76 |
The last row is the one that changes behavior. When a correction costs a couple of dollars instead of a reshoot, teams actually keep courses current. Full pack prices are on the pricing page.
Instructors, consent and offboarding
The instructor is lending their face and voice to content that may outlive their time at the company. Capture their consent at avatar creation with a clear description of how the avatar will be used, and decide upfront what happens when they leave: keep existing lessons, stop new renders, and delete the avatar when agreed. DELETE /avatars/:id removes the avatar and its cloned voice. PitchTwin's Terms require every person in an avatar to have agreed to it.
Try it
Have an instructor record a short clip, create the avatar in the dashboard, and paste one lesson script into the Playground to hear the pacing. Sign up for 60 free seconds with no card, then follow the docs to wire lessons into your platform.