### Voice Cloning Walkthrough for Windows (PyCharm Terminal)
**Forget Bash. This is for the PyCharm terminal on Windows 11.**
#### 1. Create Project & Virtual Environment
1. Open PyCharm
2. Create new project: `voice_clone`
3. Open Terminal (bottom tab)
#### 2. Create requirements.txt
In PyCharm:
1. Right-click project → New → File
2. Name it `requirements.txt`
3. Paste this exact content:
```txt
torch==2.0.1+cu118
torchvision==0.15.2+cu118
torchaudio==2.0.2+cu118
--index-url https://download.pytorch.org/whl/cu118
TTS==0.20.2
soundfile==0.12.1
librosa==0.10.1
```
#### 3. Install Dependencies
In PyCharm Terminal run:
```cmd
# Create virtual environment
python -m venv venv
# Activate it
.\venv\Scripts\activate.bat
# Install everything from requirements.txt
pip install -r requirements.txt
```
Wait for everything to install (will take several minutes).
#### 4. Create clone_script.py
Right-click project → New → Python File → Name it `clone_script.py`
Paste this code:
```python
```
#### 5. Add Your Audio Sample
1. Get a clean 5-10 second audio file (.wav format)
2. Name it `sample.wav`
3. Drag and drop it into your PyCharm project folder
#### 6. Run It
In PyCharm Terminal (make sure `(venv)` is showing):
```cmd
python clone_script.py
```
First run will download the model. Subsequent runs take seconds.
#### 7. Find Your Output
- Look in your project folder for `output.wav`
- Play it with any media player
**Notes:**
- Use forward slashes in paths: `"C:/Users/Name/audio.wav"`
- If you get errors, delete the `venv` folder and restart from step 3
- GPU makes it fast, CPU makes it slow but works
**Forget Bash. This is for the PyCharm terminal on Windows 11.**
#### 1. Create Project & Virtual Environment
1. Open PyCharm
2. Create new project: `voice_clone`
3. Open Terminal (bottom tab)
#### 2. Create requirements.txt
In PyCharm:
1. Right-click project → New → File
2. Name it `requirements.txt`
3. Paste this exact content:
```txt
torch==2.0.1+cu118
torchvision==0.15.2+cu118
torchaudio==2.0.2+cu118
--index-url https://download.pytorch.org/whl/cu118
TTS==0.20.2
soundfile==0.12.1
librosa==0.10.1
```
#### 3. Install Dependencies
In PyCharm Terminal run:
```cmd
# Create virtual environment
python -m venv venv
# Activate it
.\venv\Scripts\activate.bat
# Install everything from requirements.txt
pip install -r requirements.txt
```
Wait for everything to install (will take several minutes).
#### 4. Create clone_script.py
Right-click project → New → Python File → Name it `clone_script.py`
Paste this code:
```python
Python:
from TTS.api import TTS
import torch
# Setup
device = "cuda" if torch.cuda.is_available() else "cpu"
print(f"Using device: {device}")
# Init model (will download ~2GB first time)
tts = TTS("tts_models/multilingual/multi-dataset/xtts_v2").to(device)
# Generate audio
tts.tts_to_file(
text="Whatever you want the voice to say goes here.",
speaker_wav="sample.wav", # Put your audio file in project folder
language="en",
file_path="output.wav"
)
print("Done. Check output.wav")
#### 5. Add Your Audio Sample
1. Get a clean 5-10 second audio file (.wav format)
2. Name it `sample.wav`
3. Drag and drop it into your PyCharm project folder
#### 6. Run It
In PyCharm Terminal (make sure `(venv)` is showing):
```cmd
python clone_script.py
```
First run will download the model. Subsequent runs take seconds.
#### 7. Find Your Output
- Look in your project folder for `output.wav`
- Play it with any media player
**Notes:**
- Use forward slashes in paths: `"C:/Users/Name/audio.wav"`
- If you get errors, delete the `venv` folder and restart from step 3
- GPU makes it fast, CPU makes it slow but works