189 lines
8.7 KiB
HTML
189 lines
8.7 KiB
HTML
<!--
|
|
This is free software for the public good of a permacomputer hosted at
|
|
permacomputer.com, an always-on computer by the people, for the people.
|
|
One which is durable, easy to repair, & distributed like tap water
|
|
for machine learning intelligence.
|
|
|
|
The permacomputer is community-owned infrastructure optimized around
|
|
four values:
|
|
|
|
TRUTH First principles, math & science, open source code freely distributed
|
|
FREEDOM Voluntary partnerships, freedom from tyranny & corporate control
|
|
HARMONY Minimal waste, self-renewing systems with diverse thriving connections
|
|
LOVE Be yourself without hurting others, cooperation through natural law
|
|
|
|
This software contributes to that vision by making machine learning
|
|
accessible to everyone through a free, open, embeddable chat interface.
|
|
Code is seeds to sprout on any abandoned technology.
|
|
-->
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta name="theme-color" content="#43a047">
|
|
<meta name="color-scheme" content="light dark">
|
|
<title>XTTS v2 | uncloseai-speech | uncloseai.com</title>
|
|
<meta name="description" content="XTTS v2: high-definition voice cloning from 6-second samples. 16 languages with auto-detection. Self-host with uncloseai-speech.">
|
|
|
|
<link rel="stylesheet" href="/css/pico.classless.min.css">
|
|
<link rel="stylesheet" href="/css/chunkfive/stylesheet.css" type="text/css" charset="utf-8" />
|
|
<link rel="stylesheet" href="/css/sidebar-theme.css">
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.10.0/styles/a11y-dark.min.css" />
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.6.0/highlight.min.js"></script>
|
|
|
|
<script>
|
|
function switchTheme(theme) {
|
|
if (theme === "auto") {
|
|
document.documentElement.removeAttribute('data-theme');
|
|
} else {
|
|
document.documentElement.setAttribute('data-theme', theme);
|
|
}
|
|
}
|
|
window.UNCLOSEAI_CUSTOM_STYLING = false;
|
|
</script>
|
|
<script src="https://uncloseai.com/uncloseai.js" type="module"></script>
|
|
</head>
|
|
|
|
<body>
|
|
<button class="sidebar-toggle" onclick="document.querySelector('.sidebar').classList.toggle('open')">
|
|
☰
|
|
</button>
|
|
|
|
<aside class="sidebar">
|
|
<div class="table-of-contents">
|
|
<nav>
|
|
<ul>
|
|
<li><a href="/">Home</a></li>
|
|
<li><a href="/c-examples.html">C Examples</a></li>
|
|
<li><a href="/csharp-examples.html">C# Examples</a></li>
|
|
<li><a href="/dart-examples.html">Dart Examples</a></li>
|
|
<li><a href="/elixir-examples.html">Elixir Examples</a></li>
|
|
<li><a href="/go-examples.html">Go Examples</a></li>
|
|
<li><a href="/java-examples.html">Java Examples</a></li>
|
|
<li><a href="/kotlin-examples.html">Kotlin Examples</a></li>
|
|
<li><a href="/nodejs-examples.html">Node.js Examples</a></li>
|
|
<li><a href="/php-examples.html">PHP Examples</a></li>
|
|
<li><a href="/python-examples.html">Python Examples</a></li>
|
|
<li><a href="/ruby-examples.html">Ruby Examples</a></li>
|
|
<li><a href="/rust-examples.html">Rust Examples</a></li>
|
|
<li><a href="/swift-examples.html">Swift Examples</a></li>
|
|
<li><a href="/uncloseai-js.html">uncloseai.js Docs</a></li>
|
|
<li><a href="/uncloseai-js-styleguide.html">Styleguide</a></li>
|
|
<li><a href="/cli.html">uncloseai-cli</a></li>
|
|
<li><a href="/browser-toys.html">Browser Toys</a></li>
|
|
<li><a href="/inference.html">Inference Setup</a></li>
|
|
<li><a href="/text-to-speech.html">Text-to-Speech</a></li>
|
|
<li><a href="/tts/voice-cloning.html" style="padding-left:2em">Qwen3-TTS</a></li>
|
|
<li><a href="/tts/fast-synthesis.html" style="padding-left:2em">Piper TTS</a></li>
|
|
<li><a href="/tts/hd-cloning.html" class="active" style="padding-left:2em">XTTS v2</a></li>
|
|
<li><a href="/tts/multilingual-cpu.html" style="padding-left:2em">Silero TTS</a></li>
|
|
<li><a href="/tts/lightweight.html" style="padding-left:2em">Kokoro TTS</a></li>
|
|
<li><a href="/crawler.html">Our Crawler</a></li>
|
|
<li><a href="/reverse-retrieval-augmented-generations-rag.html">Reverse RAG</a></li>
|
|
<li><a href="/languages" target="_blank">All Languages</a></li>
|
|
<li><a href="https://shop.unturf.com/p/8486f492-a93e-11f0-b477-02dfe05770ee/uncloseai-machine-learning-reference-guide-to-inference-clients" target="_blank">Book</a></li>
|
|
</ul>
|
|
</nav>
|
|
</div>
|
|
</aside>
|
|
|
|
<main>
|
|
<header>
|
|
<hgroup>
|
|
<a href="https://uncloseai.com"><h1 class="unturf" style="font-family: 'ChunkFiveRegular';">uncloseai.</h1></a>
|
|
<p>XTTS v2</p>
|
|
</hgroup>
|
|
<nav>
|
|
<ul>
|
|
<li><a href="#" onclick="switchTheme('auto')">Auto</a></li>
|
|
<li><a href="#" onclick="switchTheme('light')">Light</a></li>
|
|
<li><a href="#" onclick="switchTheme('dark')">Dark</a></li>
|
|
</ul>
|
|
</nav>
|
|
</header>
|
|
|
|
<p><strong>Self-host</strong> — Not on the public endpoint. Clone the repo to use this engine.</p>
|
|
|
|
<h2>What It Does</h2>
|
|
|
|
<p>This is the high-fidelity voice cloning engine. Give it a 6-second audio sample of anyone's voice, and it will speak in that voice across 16 languages. It automatically detects the language of your input text.</p>
|
|
|
|
<p>Built on the Coqui TTS project — one of the most important open-source TTS efforts that was abandoned when the company shut down. We rescued it. The raccoons dug deep for this one.</p>
|
|
|
|
<p>Best for audiobooks, character voices, personalized assistants, or any time you want the output to sound like a specific person. Requires a GPU with about 4GB of VRAM.</p>
|
|
|
|
<h2>Example</h2>
|
|
|
|
<p>Once self-hosted and enabled, it works through the same OpenAI-compatible API:</p>
|
|
|
|
<pre><code class="python">from openai import OpenAI
|
|
|
|
client = OpenAI(
|
|
api_key="not-needed",
|
|
base_url="http://localhost:8000/v1"
|
|
)
|
|
|
|
# HD cloning uses tts-1-hd model
|
|
client.audio.speech.create(
|
|
model="tts-1-hd",
|
|
voice="my_voice",
|
|
input="This voice was cloned from a six-second recording. The original Coqui project may be gone, but the raccoons kept it alive."
|
|
).stream_to_file("hd-cloned.mp3")</code></pre>
|
|
|
|
<h2>Clone Your Own Voice</h2>
|
|
|
|
<pre><code class="bash"># Record 10 seconds of clean audio
|
|
ffmpeg -f alsa -i default -ac 1 -ar 22050 -t 10 -y my_voice.wav
|
|
|
|
# Clean up background noise
|
|
ffmpeg -i my_voice.wav \
|
|
-af "highpass=f=200, lowpass=f=3000, afftdn=nf=25" \
|
|
-ac 1 -ar 22050 my_voice_clean.wav
|
|
|
|
# Copy to voices directory
|
|
cp my_voice_clean.wav ~/uncloseai-speech/voices/me.wav</code></pre>
|
|
|
|
<p>Then add it to <code>config/voice_to_speaker.yaml</code>:</p>
|
|
|
|
<pre><code class="yaml">tts-1-hd:
|
|
my_voice:
|
|
model: xtts
|
|
speaker: voices/me.wav
|
|
language: en</code></pre>
|
|
|
|
<h2>Technical Details</h2>
|
|
|
|
<ul>
|
|
<li><strong>Languages:</strong> 16 with automatic detection</li>
|
|
<li><strong>Voice cloning:</strong> From 6-second audio samples</li>
|
|
<li><strong>Hardware:</strong> GPU required (~4GB VRAM)</li>
|
|
<li><strong>Upstream:</strong> <a href="https://huggingface.co/coqui/XTTS-v2" target="_blank">XTTS v2 / Coqui TTS</a> (community-maintained)</li>
|
|
</ul>
|
|
|
|
<h2>Self-Hosting</h2>
|
|
|
|
<pre><code class="bash">git clone https://git.unturf.com/engineering/unturf/uncloseai-speech.git
|
|
cd uncloseai-speech
|
|
make deploy
|
|
make voices-xtts</code></pre>
|
|
|
|
<p>Uncomment the <code>tts-1-hd</code> section in <code>voice_to_speaker.default.yaml</code> and restart.</p>
|
|
|
|
<p><a href="/text-to-speech.html"><strong>← Back to Text-to-Speech overview</strong></a></p>
|
|
|
|
<script>hljs.highlightAll();</script>
|
|
|
|
<footer>
|
|
<small>© uncloseai. 2025</small>
|
|
<br>
|
|
<small>Stylesheets by <a href="https://picocss.com" target="_blank">PicoCSS</a></small>
|
|
<small>& <a href="https://highlightjs.org/" target="_blank">highlight.js</a></small>
|
|
<br>
|
|
<small><a href="/privacy-policy.html">Privacy Policy</a> | <a href="/terms-of-use.html">Terms of Use</a></small>
|
|
</footer>
|
|
</main>
|
|
</body>
|
|
|
|
</html>
|