# 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 - `video-generator/scripts/combine_video_audio.py` — one-step final video generation, or two-step audio replacement - `video-generator/scripts/make_voiceover_macos.py` — creates timed WAV/optional MP3 voiceover on macOS - `video-generator/scripts/make_voiceover_windows.py` — creates timed WAV/optional MP3 voiceover on Windows - `video-generator/subtitles/` — optional place to keep SRT files - `video-generator/output/` — optional place to save generated audio/video files ## Install ### Windows ```powershell winget install Gyan.FFmpeg ``` Install Python from `python.org` or Microsoft Store, then reopen PowerShell and check: ```powershell ffmpeg -version python --version ``` ### macOS ```bash brew install ffmpeg ``` Python is already available on most Macs. If needed, install it from `python.org`. ## One-step flow: create final video from SRT Use this when you already have the tutorial video and the `.srt` narration file. It creates temporary voiceover audio, removes the video's original audio, exports the final MP4, and deletes temporary voice parts automatically. ### Windows ```powershell python video-generator/scripts/combine_video_audio.py ` --video "video-generator/input/your_video.mp4" ` --srt "video-generator/subtitles/your_subtitles.srt" ` --voice "Microsoft David Desktop" ` --rate 0 ` --output "video-generator/output/final_video.mp4" ``` ### macOS ```bash python video-generator/scripts/combine_video_audio.py \ --video "video-generator/input/your_video.mp4" \ --srt "video-generator/subtitles/your_subtitles.srt" \ --voice "Daniel" \ --rate 185 \ --output "video-generator/output/final_video.mp4" ``` `--voice` and `--rate` are optional. If omitted, the script uses the default voice and speed for your operating system. ## Two-step flow: create voiceover Use this when you want to review or edit the generated audio before combining it with the video. ### Windows ```powershell python video-generator/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 ```bash 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. ## Two-step flow: combine video + audio This removes the original video audio and uses the generated voiceover. ### Windows ```powershell 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 ```bash 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 ```powershell 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`: ```powershell python video-generator/scripts/combine_video_audio.py ` --video "video-generator/input/your_video.mp4" ` --srt "video-generator/subtitles/your_subtitles.srt" ` --output "video-generator/output/final_video.mp4" ` --voice "Microsoft David Desktop" ` --rate 2 ``` To add voices: `Settings > Time & language > Speech > Manage voices > Add voices`. ### macOS voice list ```bash say -v '?' ``` Good tutorial voices: `Daniel`, `Reed (English (US))`, `Eddy (English (UK))`. Speed example: ```bash python video-generator/scripts/combine_video_audio.py \ --video "video-generator/input/your_video.mp4" \ --srt "video-generator/subtitles/your_subtitles.srt" \ --output "video-generator/output/final_video.mp4" \ --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.