Skip to main content

Replace voices in youtube videos

Reason this release was yanked:

wrong version number

Project description

TurnVoice

A command-line tool to replace voices in youtube videos.

Installation

pip install turnvoice

For faster rendering prepare your CUDA environment:

CUDA 11.8:

pip install torch==2.1.1+cu118 torchaudio==2.1.1+cu118 --index-url https://download.pytorch.org/whl/cu118

CUDA v12.1:

pip install torch==2.1.1+cu118 torchaudio==2.1.1+cu211 --index-url https://download.pytorch.org/whl/cu211

Usage

turnvoice -u <YouTube Video URL> -rw <Reference WAV File> -ov <Output Video Filename>

Parameters Explained:

  • -u, --url: (required) The YouTube video URL you want to transform.
  • -l, --language: The language for transcription and synthesis (default: 'en').
  • -dd, --download_directory: Where to save the video downloads (default: 'downloads').
  • -sd, --synthesis_directory: Where to save the text to speech audio files (default: 'synthesis').
  • -e, --extract: Use with -e to extract audio directly from the video (may lead to lower quality but can reduce likelihood of errors)
  • -rw, --reference_wav: Your chosen voice in wav format (24kHz, 16 bit, mono, ~10-30s)
  • -ov, --output_video: The grand finale video file name (default: 'final_cut.mp4').

Example Command:

Ever wanted Arthur Morgan to narrate a cooking tutorial? Here's how:

turnvoice -u https://www.youtube.com/watch?v=AmC9SmCBUj4 -rw arthur.wav -ov cooking_with_arthur.mp4

This example needs a arthur.wav clone wav file in the same directory. Works when executed from the tests directory.

Pro Tips

The Art of Choosing a Reference Wav

  • A 24000, 44100 or 22050 Hz 16-bit mono wav file of 10-30 seconds is your golden ticket.
  • 24k mono 16 is my default, but I also had voices where I found 44100 32-bit to yield best results
  • I test voices with this tool before rendering
  • Audacity is your friend for adjusting sample rates. Experiment with frame rates for best results!

Fixed TTS Model Download Folder

Keep your models organized! Set COQUI_MODEL_PATH to your preferred folder.

Windows example:

setx COQUI_MODEL_PATH "C:\Downloads\CoquiModels"

Future Improvements

  • Optional Translation: Polyglot? Coming soon!
  • Optimized Synthesis: Reducing the synthesis tries for faster results.
  • Voice Cloning from YouTube: Imagine cloning voices directly from other videos!

License

TurnVoice is proudly under the Coqui Public Model License 1.0.0.

Let's Make It Fun! 🎉

Share your funniest or most creative TurnVoice creations with me!

And if you've got a cool feature idea or just want to say hi, drop me a line on

Don't forget to leave a star.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

TurnVoice-0.0.2.tar.gz (2.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

TurnVoice-0.0.2-py3-none-any.whl (3.1 MB view details)

Uploaded Python 3

File details

Details for the file TurnVoice-0.0.2.tar.gz.

File metadata

  • Download URL: TurnVoice-0.0.2.tar.gz
  • Upload date:
  • Size: 2.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for TurnVoice-0.0.2.tar.gz
Algorithm Hash digest
SHA256 fdc4e4a10343234108f2ca2676dcc56ff40ca72c427066c856fc1db4fad8ee24
MD5 3312d168ee67ccf10efd3c20b77b1f06
BLAKE2b-256 5d6618dff6d4b4c55f35258c5e44c04708a4aa3ccc214df4e6c0009fc5e22acf

See more details on using hashes here.

File details

Details for the file TurnVoice-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: TurnVoice-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for TurnVoice-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 93af1f9c044a81b76e429140ce0dbdbf8ccd88acbcfa9ed6021dd8d13b2e5d2c
MD5 76d6c5bacf81c2d19a1d1e06e273d6a3
BLAKE2b-256 10f6f5b0fc5c814525251985a7ecdee337e7b6a0ef643d1f4981c788a4701dc4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page