Skip to content

Foreign Whispers uses mutliple APIs to translate the audio of a video into a different language. It also generates subtitles for the translated audio.

Notifications You must be signed in to change notification settings

johnnymayodev/Foreign-Whispers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Foreign Whispers

Authors

❗️❗️ HOW TO RUN UI ❗️❗️

  1. Install Flask
pip install Flask
  1. Run the UI.py file
python3 UI.py
  1. Open the following link in your browser
http://127.0.0.1:37000/
  1. Enjoy!
  • Note: Refresh the page to go back to the home page

Supported Operating Systems

  • Linux
  • MacOS (not recommended)

Warning

Running on macOS is not recommended. First, ensure that you have downloaded all the dependancies (including FFmpeg). Second, if you're getting an error about FFmpeg not being found, then you need to add FFmpeg to your PATH.

For example, if you installed FFmpeg using Homebrew, then you can add the following lines of code to line 5 of libraries/milestone_2.py:

ffmpeg_path = "/opt/homebrew/bin/ffmpeg"
os.environ["PATH"] += f":{os.path.dirname(ffmpeg_path)}"
os.environ["IMAGEIO_FFMPEG_EXE"] = ffmpeg_path

Dependencies

Python (pip)

Milestone 1

pytube

YouTube Transcript/Subtitle API

pip install pytube
pip install youtube-transcript-api

Milestone 2

MoviePy

openai/whisper

pip install moviepy
pip install openai-whisper

Milestone 3

argos-translate

pip install argostranslate

Milestone 4

coqui TTS

pydub

pip install TTS
pip install pydub

Command Line Tools

Milestone 2

FFmpeg

# on Ubuntu or Debian
sudo apt update && sudo apt install ffmpeg

# on Arch Linux
sudo pacman -S ffmpeg

# on MacOS using Homebrew (https://brew.sh/)
brew install ffmpeg

ImageMagick

# Ubuntu or Debian
sudo apt update && sudo apt install imagemagick

# Homebrew (MacOS)
brew install imagemagick

Usage

MacOS/Linux

cd /path/to/dir
python3 ./main.py

Running the script will create new folders in the current directory (where you're running the script from).

About

Foreign Whispers uses mutliple APIs to translate the audio of a video into a different language. It also generates subtitles for the translated audio.

Topics

Resources

Stars

Watchers

Forks