Videos can be very effective in teaching, but I myself never make them because I don't like narrating videos nor video editing. So that got me thinking whether text-to-speech can be used to generate videos automatically. That's what I hacked together now in the `trv` Rust crate (it's a binary that you can install via cargo install, see <a href="https://github.com/transformrs/trv">https://github.com/transformrs/trv</a> for the source code and docs).<p>It's a tool that you can give a Typst presentation with speaker notes to. Next, the tool will turn the Typst file into images and audio, and then turn everything into a video.<p>For example, I made one I video about a blog post that I wrote earlier. Unfortunately, I cannot directly upload a video here on HN, so here is a link: <a href="https://youtu.be/vn8-Asioxq8" rel="nofollow">https://youtu.be/vn8-Asioxq8</a>.<p>To give an idea of how the video was made, here is the first slide of the Typst presentation:<p><pre><code> #import "@preview/polylux:0.4.0": *
#set page(paper: "presentation-16-9", margin: 1in)
#set text(size: 30pt)
#slide[
#toolbox.pdfpc.speaker-note(
```md
Iterators are pretty cool.
For example, in Python we could write the following code in a normal loop.
Here we have a list of 3 values and we add 1 to each value.
This returns a new list with the values `[2, 3, 4]`.
```
)
```python
values = [1, 2, 3]
for i in range(len(values)):
values[i] += 1
print(values)
# [2, 3, 4]
```
]
</code></pre>
Next, I ran the following command:<p><pre><code> $ trv --input=presentation.typ \
--model='hexgrad/Kokoro-82M' \
--voice='am_liam' \
--release"
</code></pre>
This created a video of 1.2 MB that I then uploaded to YouTube.<p>Is a tool like this useful? What are your thoughts?
This idea seems fantastic. One of my back-burner projects is a suite of lower-level video rendering software in Python, but this would let me get certain videos out the door much more quickly, I'm sure.<p>It might be a good idea to link "Typst" in the README to the documentation (<a href="https://typst.app/docs/" rel="nofollow">https://typst.app/docs/</a>).