-
-
Notifications
You must be signed in to change notification settings - Fork 22
examples
A practical, easy-to-read guide for common Synthalingua workflows. Copy, adapt, and experiment!
Basic: Translate a Japanese Twitch stream to English (GPU):
python synthalingua.py --stream https://www.twitch.tv/somestreamerhere --stream_language Japanese --stream_translate --device cuda
With Discord notifications:
python synthalingua.py --stream https://www.twitch.tv/somestreamerhere --stream_language Japanese --stream_translate --discord_webhook "https://discord.com/api/webhooks/1234567890/1234567890"
With blocklist and auto-blocklist:
python synthalingua.py --stream https://www.youtube.com/watch?v=abc123 --stream_language Japanese --stream_translate --ignorelist "C:/path/blacklist.txt" --auto_blocklist
With web server output (view in browser):
python synthalingua.py --stream https://www.twitch.tv/somestreamerhere --stream_language Japanese --stream_translate --portnumber 8080
With cookies (for private/region-locked streams):
python synthalingua.py --stream https://www.twitch.tv/somestreamerhere --cookies twitch
Stream with cookies from browser (Recommended):
# Extract cookies from Chrome
python synthalingua.py --stream https://www.twitch.tv/somestreamerhere --cookies-from-browser chrome
# Extract cookies from Firefox
python synthalingua.py --stream https://www.youtube.com/watch?v=abc123 --cookies-from-browser firefox
# Extract cookies from Edge
python synthalingua.py --stream https://www.twitch.tv/somestreamerhere --cookies-from-browser edge
Custom chunk size and padded audio (for better context):
python synthalingua.py --stream https://www.twitch.tv/somestreamerhere --stream_chunks 4 --paddedaudio 1
Select audio stream quality (YouTube):
python synthalingua.py --stream https://www.youtube.com/watch?v=abc123 --selectsource bestaudio
Transcribe and translate live microphone input to English:
python synthalingua.py --microphone_enabled --language ja --translate --device cuda
Set a specific microphone by index or name:
python synthalingua.py --microphone_enabled --set_microphone 2
python synthalingua.py --microphone_enabled --set_microphone "Microphone (Realtek USB2.0 Audi)"
With blocklist and auto-blocklist:
python synthalingua.py --microphone_enabled --ignorelist "C:/path/blacklist.txt" --auto_blocklist
With padded audio for better context:
python synthalingua.py --microphone_enabled --mic_chunk_size 3 --paddedaudio 1
Transcribe to a non-English target language:
python synthalingua.py --microphone_enabled --language en --transcribe --target_language es
List microphones and set by index:
python synthalingua.py --list_microphones
python synthalingua.py --microphone_enabled --set_microphone 3
Basic: Generate English captions for a Japanese video file:
python synthalingua.py --makecaptions --file_input "C:/Videos/myvideo.mp4" --file_output "C:/Videos/captions" --file_output_name "MyCaptionsFile" --language Japanese --device cuda
Compare all models for quality:
python synthalingua.py --makecaptions compare --file_input "C:/Videos/myvideo.mp4" --file_output "C:/Videos/captions" --file_output_name "MyCaptionsFile" --language Japanese
With vocal isolation (removes music/noise, requires demucs):
python synthalingua.py --makecaptions --isolate_vocals --file_input "C:/Videos/myvideo.mp4" --file_output "C:/Videos/captions" --file_output_name "MyCaptionsFile"
With silence detection (faster for files with silent periods):
python synthalingua.py --makecaptions --silent_detect --file_input "C:/Videos/myvideo.mp4" --file_output "C:/Videos/captions" --file_output_name "MyCaptionsFile"
With custom silence threshold (for quiet speech):
python synthalingua.py --makecaptions --silent_detect --silent_threshold -45.0 --file_input "C:/Videos/myvideo.mp4" --file_output "C:/Videos/captions" --file_output_name "MyCaptionsFile"
With custom silence duration (ignore pauses under 2s):
python synthalingua.py --makecaptions --silent_detect --silent_duration 2.0 --file_input "C:/Videos/myvideo.mp4" --file_output "C:/Videos/captions" --file_output_name "MyCaptionsFile"
RECOMMENDED: Vocal isolation + silence detection:
python synthalingua.py --makecaptions --isolate_vocals --silent_detect --file_input "C:/Videos/myvideo.mp4" --file_output "C:/Videos/captions" --file_output_name "MyCaptionsFile"
RECOMMENDED: With custom settings for natural speech with pauses:
python synthalingua.py --makecaptions --isolate_vocals --silent_detect --silent_threshold -40.0 --silent_duration 1.5 --file_input "C:/Videos/myvideo.mp4" --file_output "C:/Videos/captions" --file_output_name "MyCaptionsFile"
With blocklist filtering:
python synthalingua.py --makecaptions --file_input "C:/Videos/myvideo.mp4" --file_output "C:/Videos/captions" --file_output_name "MyCaptionsFile" --ignorelist "C:/path/blacklist.txt"
Basic burned subtitles (permanent overlay):
python synthalingua.py --makecaptions --subtype burn --file_input "C:/Videos/myvideo.mp4" --file_output "C:/Videos/output" --file_output_name "MyVideo"
Embedded subtitles (toggleable track):
python synthalingua.py --makecaptions --subtype embed --file_input "C:/Videos/myvideo.mp4" --file_output "C:/Videos/output" --file_output_name "MyVideo"
Custom styled burned subtitles:
# Large yellow text with custom font
python synthalingua.py --makecaptions --subtype burn --substyle "FiraSans-Bold.otf,28,yellow" --file_input "C:/Videos/myvideo.mp4" --file_output "C:/Videos/output" --file_output_name "MyVideo"
# System font with custom size and color
python synthalingua.py --makecaptions --subtype burn --substyle "22,cyan" --file_input "C:/Videos/myvideo.mp4" --file_output "C:/Videos/output" --file_output_name "MyVideo"
# Custom font and size (default white color)
python synthalingua.py --makecaptions --subtype burn --substyle "FiraSans-UltraLightItalic.otf,20" --file_input "C:/Videos/myvideo.mp4" --file_output "C:/Videos/output" --file_output_name "MyVideo"
# Color only (default font and size)
python synthalingua.py --makecaptions --subtype burn --substyle "red" --file_input "C:/Videos/myvideo.mp4" --file_output "C:/Videos/output" --file_output_name "MyVideo"
# Flexible parameter order
python synthalingua.py --makecaptions --subtype burn --substyle "26,FiraSans-Bold.otf,magenta" --file_input "C:/Videos/myvideo.mp4" --file_output "C:/Videos/output" --file_output_name "MyVideo"
Complete workflow with vocal isolation and custom styling:
python synthalingua.py --makecaptions --isolate_vocals --silent_detect --subtype burn --substyle "FiraSans-Bold.otf,24,orange" --file_input "C:/Videos/myvideo.mp4" --file_output "C:/Videos/output" --file_output_name "ProfessionalVideo"
Get styling help and see available fonts:
python synthalingua.py --substyle help
Setting up custom fonts:
- Create a
fonts/
folder in your Synthalingua directory - Download font files (
.ttf
,.otf
,.woff
,.woff2
) - Place font files in the
fonts/
folder - Reference the exact filename in
--substyle
Popular free fonts to try:
- Google Fonts: fonts.google.com
- Open Font Library: fontlibrary.org
- Font Squirrel: fontsquirrel.com
Save transcript to a folder (always use both flags):
python synthalingua.py --save_transcript --save_folder "C:/transcripts"
Check for updates:
python synthalingua.py --checkupdate
Stream with cookies using full path:
python synthalingua.py --stream https://www.twitch.tv/somestreamerhere --cookies "C:/path/to/my/twitch_cookies.txt"
Stream with cookies from current directory:
python synthalingua.py --stream https://www.youtube.com/watch?v=abc123 --cookies youtube.txt
Show detected language of the stream:
python synthalingua.py --stream https://www.twitch.tv/somestreamerhere --stream_original_text
Legacy: Translate stream using deprecated argument (still supported):
python synthalingua.py --stream https://www.twitch.tv/somestreamerhere --stream_target_language English
For more details on each argument, see the other docs in this folder or the README.