Files
Tutorials/video-generator/README.md
T
2026-06-16 11:54:06 +03:30

3.5 KiB

Video Generator Voiceover

Small helper scripts for creating timed tutorial voiceovers from .srt files and replacing a video's original audio with the generated voiceover.

Files

  • scripts/make_voiceover_macos.py — creates timed WAV/optional MP3 voiceover on macOS
  • scripts/make_voiceover_windows.py — creates timed WAV/optional MP3 voiceover on Windows
  • scripts/combine_video_audio.py — replaces video audio and exports final MP4
  • subtitles/ — optional place to keep SRT files
  • output/ — optional place to save generated audio/video files

Install

Windows

winget install Gyan.FFmpeg

Install Python from python.org or Microsoft Store, then reopen PowerShell and check:

ffmpeg -version
python --version

macOS

brew install ffmpeg

Python is already available on most Macs. If needed, install it from python.org.

Create voiceover

Run from the video-generator folder. Pass your own SRT and output paths.

Windows

python scripts/make_voiceover_windows.py `
  --srt "video-generator/subtitles/your_subtitles.srt" `
  --voice "Microsoft David Desktop" `
  --rate 0 `
  --wav "video-generator/output/voiceover.wav" `
  --mp3 "video-generator/output/voiceover.mp3"

macOS

python video-generator/scripts/make_voiceover_macos.py \
  --srt "video-generator/subtitles/your_subtitles.srt" \
  --voice "Daniel" \
  --rate 185 \
  --wav "video-generator/output/voiceover.wav" \
  --mp3 "video-generator/output/voiceover.mp3"

--mp3 is optional. Use WAV when combining with video.

Combine video + audio

This removes the original video audio and uses the generated voiceover.

Windows

python video-generator/scripts/combine_video_audio.py `
  --video "video-generator/input/your_video.mp4" `
  --audio "video-generator/output/voiceover.wav" `
  --output "video-generator/output/final_video.mp4"

macOS

python video-generator/scripts/combine_video_audio.py \
  --video "video-generator/input/your_video.mp4" \
  --audio "video-generator/output/voiceover.wav" \
  --output "video-generator/output/final_video.mp4"

Use absolute paths if files are outside this folder.

Voice and speed options

Windows voice list

Add-Type -AssemblyName System.Speech
$synth = New-Object System.Speech.Synthesis.SpeechSynthesizer
$synth.GetInstalledVoices() | ForEach-Object { $_.VoiceInfo.Name }

Good tutorial voices: Microsoft David Desktop, Microsoft Mark if available.

Windows speed uses -10 to 10:

python video-generator/scripts/make_voiceover_windows.py `
  --srt "video-generator/subtitles/your_subtitles.srt" `
  --wav "video-generator/output/voiceover.wav" `
  --voice "Microsoft David Desktop" `
  --rate 2

To add voices: Settings > Time & language > Speech > Manage voices > Add voices.

macOS voice list

say -v '?'

Good tutorial voices: Daniel, Reed (English (US)), Eddy (English (UK)).

Speed example:

python video-generator/scripts/make_voiceover_macos.py \
  --srt "video-generator/subtitles/your_subtitles.srt" \
  --wav "video-generator/output/voiceover.wav" \
  --voice "Daniel" \
  --rate 190

Notes

If a caption has too much text for its time slot, the script keeps the SRT timing and trims the speech. Fix that by increasing the subtitle duration, shortening the sentence, or increasing speed.

If the final MP4 has compatibility issues, add --reencode-video to the combine command.