Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

🎙️ Voice Cloner (Python)

A Python-based voice cloning application that records a voice sample and generates speech in the same voice using an AI-powered Text-to-Speech model.

This project was built as a learning-focused backend/AI application, demonstrating audio processing and speech synthesis using Python.


✨ Features

  • 🎤 Voice Recording – Record a reference voice sample using a microphone
  • 🧠 Voice Cloning – Generate speech that mimics the recorded voice
  • 🌍 Multilingual Support – Supports multiple languages
  • ⏱️ Adjustable Speed – Control the playback speed of generated speech

🛠️ Tech Stack

  • Python
  • Coqui TTS
  • sounddevice
  • scipy
  • Audio Processing & ML Concepts

📦 Installation

Prerequisites

  • Python 3.8 or higher
  • pip (Python package manager)
  • Microphone (for voice recording)
  • GPU (optional – improves performance, CPU also works)

Setup

  1. Install required dependencies
pip install TTS sounddevice scipy
  1. First Run Note
  • On the first run, the TTS model (~500MB–1GB) will be downloaded automatically

  • Ensure:

    • Stable internet connection
    • At least 1GB free disk space

🚀 Usage

Step 1: Record Voice Sample

python record_sample.py
  • Recording starts after a short delay
  • Speak clearly and naturally
  • Output file: my_voice.wav
  • You can modify recording duration inside the script

Step 2: Generate Cloned Voice

python clone_voice.py
  • Enter the text you want to convert to speech
  • Uses my_voice.wav as the reference
  • Output file: output.wav
  • Speech speed can be adjusted using the speed parameter

📁 Project Structure

Voice-Cloner/
├── record_sample.py    # Records voice sample
├── clone_voice.py      # Generates cloned speech
└── README.md           # Project documentation

⚙️ Configuration

record_sample.py

  • SAMPLE_RATE – Audio sample rate (default: 16000 Hz)
  • DURATION – Recording time in seconds
  • output_file – Output voice sample file name

clone_voice.py

  • ref_audio_path – Reference voice file path
  • out_path – Generated audio output path
  • language – Language code (default: "en")
  • speed – Speech speed multiplier

🧪 Troubleshooting

Module not found

  • Run: pip install TTS sounddevice scipy
  • Check Python version: python --version

No audio recorded

  • Check microphone connection
  • Verify system audio permissions

Slow performance

  • First run model download is expected
  • GPU significantly improves speed
  • Ensure sufficient RAM availability

Low audio quality

  • Record in a quiet environment
  • Speak clearly
  • Increase recording duration if needed

🧠 Model Information

  • Model: tts_models/multilingual/multi-dataset/your_tts
  • Languages: Multilingual
  • Disk Size: ~500MB–1GB
  • Minimum RAM: ~4GB
  • GPU: Recommended (optional)

📚 Learning Outcomes

  • Practical experience with audio data handling
  • Understanding voice cloning & speech synthesis
  • Hands-on use of Python for backend and AI workflows
  • Exposure to machine learning models

📜 License & Credits

This project uses the Coqui TTS open-source engine.


About

A Python-based voice cloning project that replicates a person's voice using sample audio input. The system processes audio data and generates cloned speech using machine learning techniques.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages