{"id":50127364,"url":"https://github.com/zefir1990/tts2mp3","last_synced_at":"2026-05-23T20:34:41.160Z","repository":{"id":345552537,"uuid":"1185931907","full_name":"zefir1990/tts2mp3","owner":"zefir1990","description":"TTS to mp3","archived":false,"fork":false,"pushed_at":"2026-03-19T15:24:37.000Z","size":7,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-20T07:47:48.801Z","etag":null,"topics":["tts"],"latest_commit_sha":null,"homepage":"https://demensdeum.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zefir1990.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-19T04:48:04.000Z","updated_at":"2026-03-19T16:54:30.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/zefir1990/tts2mp3","commit_stats":null,"previous_names":["zefir1990/tts2mp3"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/zefir1990/tts2mp3","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zefir1990%2Ftts2mp3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zefir1990%2Ftts2mp3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zefir1990%2Ftts2mp3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zefir1990%2Ftts2mp3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zefir1990","download_url":"https://codeload.github.com/zefir1990/tts2mp3/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zefir1990%2Ftts2mp3/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33412082,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-23T18:09:33.147Z","status":"ssl_error","status_checked_at":"2026-05-23T18:09:31.380Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["tts"],"created_at":"2026-05-23T20:34:40.427Z","updated_at":"2026-05-23T20:34:41.154Z","avatar_url":"https://github.com/zefir1990.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tts2mp3\n\n`tts2mp3` is a Python script that converts text to high-quality speech and saves it as an MP3 file using the **Coqui-TTS** engine. It supports multiple languages (including Russian and English) and voice cloning via XTTS-v2.\n\n## Features\n\n- **High-Quality TTS**: Uses Coqui-TTS's advanced models.\n- **Multilingual**: Supports Russian, English, and 15+ other languages.\n- **Voice Cloning**: Clone any voice using a 6-second reference audio clip with XTTS-v2.\n- **MP3 Output**: Automatically converts synthesized audio to MP3 format.\n\n## Prerequisites\n\nBefore running the script, you'll need:\n\n1.  **Python \u003e= 3.9, \u003c 3.12** (Important: `coqui-tts` has compatibility issues with Python 3.12+)\n2.  **FFmpeg**: Required by `pydub` for MP3 conversion.\n    - [Download FFmpeg](https://ffmpeg.org/download.html)\n    - Ensure `ffmpeg` is in your system PATH.\n\n## Installation\n\n1.  Clone the repository or download the script.\n2.  Create and activate a virtual environment (recommended):\n    ```powershell\n    python -m venv tts-env\n    .\\tts-env\\Scripts\\activate\n    ```\n3.  Install the dependencies:\n    ```bash\n    pip install -r requirements.txt\n    ```\n\n## Usage\n\n### 🚀 Basic Usage (English)\n```bash\npython tts2mp3.py --text \"Hello world\" --output hello.mp3\n```\n\n### 🇷🇺 Russian (Standard Voice)\nUses the VITS model which does **not** require a reference voice.\n```bash\npython tts2mp3.py --text \"Привет, это тест.\" --model \"tts_models/ru/multi-dataset/vits\" --language \"ru\" --output privet.mp3\n```\n\n### 👤 High-Quality Voice Cloning (XTTS-v2)\nRequires a 6-second reference WAV file of the target voice.\n```bash\npython tts2mp3.py --text \"Привет, я говорю вашим голосом.\" --model \"tts_models/multilingual/multi-dataset/xtts_v2\" --language \"ru\" --speaker_wav \"reference.wav\" --output clone.mp3\n```\n\n## All Arguments\n\n- `--text`: Direct text to convert.\n- `--file`: Path to a text file to convert.\n- `--output`: Output MP3 path (default: `output.mp3`).\n- `--model`: Coqui-TTS model name (default: `tts_models/en/ljspeech/glow-tts`).\n- `--language`: Language code (e.g., `en`, `ru`) for multilingual models.\n- `--speaker_wav`: Reference WAV for cloning (XTTS).\n- `--speaker`: Speaker name for multi-speaker models.\n- `--gpu`: Use GPU for faster synthesis if available.\n\n## Troubleshooting\n\n### 1. `ImportError: cannot import name 'BeamSearchScorer'`\nThis is caused by incompatible `transformers` versions. Ensure you are using `transformers==4.33.0` as specified in `requirements.txt`.\n\n### 2. `WeightsUnpickler` Error (PyTorch 2.6+)\nThe script includes a monkey-patch to fix this security-related conflict in newer PyTorch versions. If it persists, try re-running the script.\n\n### 3. \"Kernel size can't be greater than actual input size\"\n- Ensure you are using the correct model for the language (e.g., don't use the English model for Russian text).\n- Avoid very short text strings; adding a period or extra word can help.\n\n---\n*Created as part of an agentic coding task.*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzefir1990%2Ftts2mp3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzefir1990%2Ftts2mp3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzefir1990%2Ftts2mp3/lists"}