DaVinci Resolve Studio already has a good local AI voice generator. I built a Python script that turns an entire narration file into timeline-ready speech with one command.
The voice in my video was generated on my own computer.
No TTS website.
No account.
No script upload.
No monthly subscription.
It came from DaVinci Resolve Studio’s own AI Speech Generator.
And technically, Resolve already had almost everything I needed.
Blackmagic’s Speech Generator can generate narration from written text using its AI voice models, and Resolve Studio exposes Python and Lua scripting APIs for automation.
There was just one problem:
using it for a long script manually is miserable.
The scripting interface accepts only a relatively small amount of text per generation call.
That’s fine for a sentence or two.
It’s not fine for a ten-minute YouTube narration.
So instead of spending my time copying, pasting, waiting, dragging clips, and trying not to lose my place, I wrote a Python tool to automate the whole thing.
The goal was simple:
Give it a text file. Get a complete AI voice-over on the Resolve timeline.
The AI Voice Wasn’t the Problem
DaVinci Resolve’s Speech Generator is genuinely useful.
In Resolve 21, Blackmagic describes it as a tool that can generate spoken-word output from written text using different voices and performances. The Speech Generator model itself is installed through Resolve’s Extras Download Manager.
So I didn’t need to build a speech model.
I didn’t need to integrate a cloud TTS provider.
I didn’t need another API key.
I already owned Resolve Studio.
What I needed was a better way to feed a long script into the feature.
The 350-Character Problem
The scripting call I’m using accepts a maximum of roughly 350 characters at a time.
That sounds like a decent amount until you compare it with an actual narration script.
A couple of sentences might fit.
A full YouTube script absolutely does not.
If a narration needs 40 chunks, the manual workflow becomes:
- Copy the first section.
- Paste it into the Speech Generator.
- Generate the audio.
- Place the result on the timeline.
- Go back to the script.
- Find the next section.
- Repeat.
Forty times.
And while doing all of this:
- don’t skip a sentence
- don’t repeat one
- don’t paste too much
- don’t mix up the order
- don’t accidentally overwrite something on the timeline
At that point, I’m not editing video.
I’m doing data entry.
That is exactly the kind of problem I like automating.
One Command Instead
The script is called generate_voice.py.
Point it at a plain-text narration file and it takes care of the repetitive part.
Conceptually:
script.txt
↓
split into safe segments
↓
DaVinci Resolve Speech Generator
↓
generated audio clips
↓
AI Voice timeline track
The script:
- reads the narration
- splits it into valid chunks
- sends those chunks to Resolve in order
- caches completed generations
- verifies the batch
- places the finished clips back-to-back on a dedicated audio track
The result is the workflow I actually wanted from the beginning:
one text file
↓
one command
↓
finished narration
Dry Run Before Resolve Does Anything
Before generating any speech, I can ask the tool to show me its plan.
That’s the dry-run mode.
It doesn’t connect to Resolve.
It doesn’t generate audio.
It doesn’t touch the timeline.
It simply shows:
- how many segments the script became
- how long each one is
- whether anything exceeds the configured limit
For example, one real script of around 2,200 characters became 13 segments, with the longest well under the configured ceiling.
I like having this step because text splitting looks trivial until it isn’t.
And if the splitter is wrong, I want to discover that before generating 40 audio files.
Splitting Text Properly Is Harder Than “Every 300 Characters”
The simplest implementation would be:
Take characters 1–300.
Then 301–600.
Then 601–900.
That would also sound terrible.
You might get:
This feature is extremely use-
followed by:
ful when editing longer videos.
So the splitter works hierarchically.
It tries to preserve the structure of the original narration as long as possible.
First:
paragraphs
Then:
sentences
Then:
clauses
Then:
words
And only as a final fallback will it split inside something that cannot reasonably be broken elsewhere, such as an exceptionally long URL.
Conceptually:
Paragraph
↓ too long?
Sentence
↓ too long?
Clause
↓ too long?
Word boundary
↓ absolutely unavoidable?
Hard split
The priority is simple:
break at the most natural place available.
Your Punctuation Usually Means Something
This is one of those details that’s easy to overlook.
A blank line isn’t just whitespace.
In narration, it often means:
pause here.
Likewise, commas and semicolons can imply smaller natural breaks.
So the splitter tries to preserve the structure I wrote rather than treating the script as one giant string of characters.
It also has to recognize cases where a period doesn’t mean the end of a sentence.
For example:
Dr.e.g.3.14- URLs
Splitting those incorrectly produces unnatural speech and makes the generated clips harder to manage.
The Most Important Guarantee: It Doesn’t Rewrite the Script
I didn’t want the splitter to be “smart” in the generative-AI sense.
It shouldn’t improve my text.
It shouldn’t paraphrase.
It shouldn’t remove punctuation.
It shouldn’t silently normalize sentences.
Its job is mechanical:
divide the original text into valid pieces.
One of the invariants I test is:
Concatenate every generated segment and you should reconstruct the original source text.
Nothing added.
Nothing removed.
Nothing rewritten.
That property matters a lot to me because the narration script is the source of truth.
The automation should adapt itself to the script.
The script should not adapt itself to the automation.
Then Comes the Part That Saves the Most Time: The Manifest
Long automation needs memory.
Otherwise, one failure near the end forces you to start again from zero.
Every voice-generation run therefore creates a manifest.
The manifest tracks things like:
- the script fingerprint
- generation settings
- every segment
- the segment text
- status
- processing time
- output location
After each successful segment, the manifest is updated.
And it is written atomically.
That last part matters.
What “Atomic” Means Here
Imagine the application is writing its state when the computer loses power.
If it simply overwrites the manifest directly, I could end up with:
- half a JSON file
- corrupt state
- no reliable idea what finished
Instead, the tool writes the new state safely and only replaces the previous manifest once that write succeeds.
The practical result is:
a crash should cost me the current segment, not the entire session.
Run the same command again and previously completed segments immediately come back as cached.
So instead of:
1 ✓
2 ✓
3 ✓
...
39 ✓
40 CRASH
Start over at 1
I get:
1–39 cached
40 resume
41 continue
That’s the difference between automation I trust and automation I have to babysit.

But It Won’t Pretend an Edited Script Is the Same Job
Caching creates another problem.
Suppose I generate 40 segments.
Then I change one sentence near the beginning.
Segment numbers may shift.
What used to be segment 12 might now contain completely different text.
Blindly reusing the old cache would be dangerous.
So the manifest fingerprints the script and settings.
If the inputs no longer match the previous run, the tool refuses to silently continue.
It tells me that the job changed and requires an explicit decision before reusing or rebuilding anything.
I prefer that behaviour.
Automation should fail loudly when it cannot prove that its assumptions are still valid.
Timeline Automation Can Be Dangerous
Generating audio is only half the job.
Eventually those files need to land on the timeline.
This is where I became deliberately conservative.
A script that has permission to change a video-editing timeline can ruin actual work if it behaves badly.
So mine follows one important principle:
Never assume the timeline is empty.
Before placing narration, it inspects the intended destination track.
If something is already there, it stops.
It identifies the blocking clip.
And it exits.
It does not:
- delete the clip
- move the clip
- overwrite it
- bury it underneath generated narration
The human gets to decide what happens next.
It Also Refuses to Place an Incomplete Narration
Imagine 39 of 40 speech segments generate successfully.
The final one fails.
Technically, I could still place those 39 clips.
But then I would have a nearly complete narration sitting on my timeline with one missing section somewhere inside it.
That’s exactly the kind of subtle failure that creates problems later.
So the tool takes an all-or-nothing approach to placement.
If even one required segment is missing:
nothing gets placed.
Instead, it tells me how many succeeded and what command to run next.
Complete the generation.
Then place the narration.
That separation makes failures much easier to reason about.
Privacy Comes Almost for Free
One side effect of using Resolve’s built-in Speech Generator is that the narration workflow doesn’t require sending my script to an external TTS API.
My Python script itself has no networking dependency.
There is no account.
No token.
No cloud TTS service.
No per-character bill.
The text stays inside the local Resolve workflow.
That makes the architecture pleasantly boring:
script.txt
↓
Python
↓
DaVinci Resolve Studio
↓
local Speech Generator
↓
timeline
For unpublished narration, client projects, internal videos, or anything else I’d rather keep local, that’s useful.
Zero Third-Party Python Packages
Another thing I intentionally kept simple:
The automation uses Python’s standard library plus Resolve’s own scripting interface.
There isn’t a giant Python dependency tree behind it.
The requirements.txt deliberately installs nothing.
That means fewer moving pieces.
No HTTP library.
No automation framework.
No JSON package.
No CLI framework.
Just Python and Resolve.
Sometimes the boring solution is the better solution.
The Tests Don’t Need Resolve
The project currently has 197 unit tests, and they run in roughly a couple of seconds on my machine.
They don’t need:
- DaVinci Resolve
- a GPU
- the Speech Generator model
- network access
That’s intentional.
Most of the logic worth testing isn’t actually AI.
It’s things like:
- segmentation
- manifest handling
- script fingerprinting
- caching
- path logic
- safety checks
- error handling
Those should be deterministic and fast.
I don’t want to load an AI model every time I need to check whether sentence splitting still works.
This Is a Good Example of Where AI Isn’t the Interesting Part
There is AI in the workflow.
But I didn’t build the AI.
Blackmagic did.
The interesting part for me was everything around it.
This:
Generate speech from this text.
is already solved.
The annoying problem is:
Generate speech for this entire script, safely, reliably, resumably, in the correct order, and put it where I need it.
That is mostly traditional software engineering.
Parsing.
State.
Retries.
Validation.
File management.
Timeline safety.
This project is a good reminder that sometimes the best way to use AI isn’t to build another AI model.
It’s to build a boring, reliable workflow around one that already exists.
What You Need
There are some real requirements.
This is not a generic TTS script.
It exists specifically to automate DaVinci Resolve’s Speech Generator.
You’ll need DaVinci Resolve Studio, because Blackmagic’s advanced AI tools and scripting capabilities are part of the Studio workflow. Blackmagic currently lists Studio 21 as the paid edition with the DaVinci AI Neural Engine and scripting/automation support.
The Speech Generator model also needs to be installed through:
DaVinci Resolve → Extras Download Manager
which is the installation route documented by Blackmagic.
For my current setup, I use Resolve Studio 21 on Windows.
You’ll also need Python and external scripting enabled in Resolve.
And after changing the scripting setting:
restart Resolve.
That last part is easy to miss.
One Very Strange Python Problem
There is also one issue I hit that I don’t have a particularly satisfying explanation for.
On my Windows setup, one Python interpreter version crashes immediately when Resolve’s scripting library loads.
No Python exception.
No traceback.
The process simply disappears.
A newer interpreter works correctly on the same machine.
That’s why the tool prints the Python interpreter version when it starts.
If Resolve scripting dies instantly, that’s one of the first things I’d check.
This is also why I’d follow the current README for installation rather than hard-coding one Python version into an article forever.
Resolve, Python, and the scripting API all evolve.
There Is an Experimental Placement Mode
The project also contains an experimental mode that asks Resolve to perform more of the placement itself.
On my current Resolve build, that route doesn’t work reliably.
So I don’t hide that fact.
The tool detects the failure.
Stops.
And tells me to use the normal placement method instead.
I’m mentioning this because I increasingly dislike project pages that pretend every experimental feature works perfectly.
If something doesn’t work:
say it doesn’t work.
Especially when the software is touching someone’s editing timeline.
This Tool Is Extremely Specific
I don’t think everyone needs this.
In fact, the ideal user is almost comically specific.
Someone who:
- owns DaVinci Resolve Studio
- writes their own narration
- likes Resolve’s built-in Speech Generator
- creates long-form voice-over
- is comfortable running a Python script
- is tired of copying and pasting two sentences at a time
That’s the user.
And that’s fine.
Not every open-source project needs millions of users.
Sometimes the best tools solve a very narrow problem extremely well.
It Turned Data Entry Into a Command
That is really the entire reason this exists.
I had a repetitive task:
copy
paste
generate
drag
repeat
over and over again.
So I replaced it with:
generate_voice.py script.txt
Now I can start the job and do something else.
If Resolve stops halfway through, I can resume.
If the script changed, the tool notices.
If the timeline isn’t safe, the tool refuses to touch it.
If generation isn’t complete, it doesn’t leave me with half a narration.
Nothing here is particularly glamorous.
But it turned something I hated doing manually into something I barely have to think about anymore.
Those are often my favourite automations.
Don’t Automate the Creative Part. Automate the Copy-Paste Part.
There’s a broader principle here that I keep coming back to.
I don’t necessarily want AI or automation making every creative decision for me.
I still want to:
- write the script
- edit the video
- decide the pacing
- choose the visuals
- make the final call
What I don’t want to do is copy the same information between interfaces forty times.
That’s not creativity.
That’s friction.
If software can remove that friction without taking away the decisions I actually care about, that’s exactly where I want automation.
DaVinci Resolve already had the voice.
I just needed to stop being the person manually feeding it two sentences at a time.

Atomik Factory is where I document the software, scripts, automations, AI tools, and experiments I build for my own workflows — around technology, privacy, productivity, and open source.
Most projects begin because something is repetitive enough to annoy me.
Then I try to remove the repetition.
I document what worked.
And if somebody else has exactly the same oddly specific problem, hopefully the code saves them some time too.
Build. Learn. Share.
The DaVinci Resolve narration script is available inside my open-source Atomik Scripts repository:
github.com/atomikfactory/atomik-scripts/tree/main/python/video/davinci-script
The project is licensed under GPL-3.0.
And no, this project is not affiliated with or endorsed by Blackmagic Design.