### Set up environment with pip and run inference Source: https://github.com/misolabsai/misotts/blob/main/README.md Sets up a Python virtual environment using pip, activates it, installs the MisoTTS package in editable mode, and runs the inference script. ```bash python3.10 -m venv .venv source .venv/bin/activate pip install -e . python run_misotts.py ``` -------------------------------- ### Install uv package manager Source: https://github.com/misolabsai/misotts/blob/main/README.md Installs the uv package manager using a curl command. This is a prerequisite for managing Python environments and dependencies. ```bash curl -LsSf https://astral.sh/uv/install.sh | sh ``` -------------------------------- ### Prompted generation for voice cloning Source: https://github.com/misolabsai/misotts/blob/main/README.md Python example demonstrating how to use Miso TTS for voice cloning by conditioning generation on prior audio context. Requires torchaudio and the Segment class. ```python import torchaudio from generator import Segment, load_miso_8b generator = load_miso_8b(device="cuda") prompt_audio, sample_rate = torchaudio.load("prompt.wav") prompt_audio = torchaudio.functional.resample( prompt_audio.squeeze(0), orig_freq=sample_rate, new_freq=generator.sample_rate, ) context = [ Segment( speaker=0, text="This is the transcript for the prompt audio.", audio=prompt_audio, ) ] audio = generator.generate( text="This is the next sentence to synthesize.", speaker=0, context=context, max_audio_length_ms=10_000, ) ``` -------------------------------- ### Generate speech with Miso TTS 8B Source: https://github.com/misolabsai/misotts/blob/main/README.md Basic Python example to load the Miso TTS 8B model and generate speech from text. It saves the output audio to 'miso.wav'. Requires PyTorch and torchaudio. ```python import torch import torchaudio from generator import load_miso_8b device = "cuda" if torch.cuda.is_available() else "cpu" generator = load_miso_8b( device=device, model_path_or_repo_id="MisoLabs/MisoTTS", ) audio = generator.generate( text="Hello from Miso.", speaker=0, context=[], max_audio_length_ms=10_000, ) torchaudio.save("miso.wav", audio.unsqueeze(0).cpu(), generator.sample_rate) ``` -------------------------------- ### Clone repository and set up environment with uv Source: https://github.com/misolabsai/misotts/blob/main/README.md Clones the MisoTTS repository, synchronizes Python dependencies using uv, and activates the virtual environment. Assumes Python 3.10 is available. ```bash git clone https://github.com/MisoLabsAI/MisoTTS.git cd MisoTTS uv sync --python 3.10 source .venv/bin/activate ``` -------------------------------- ### Run Miso TTS inference script Source: https://github.com/misolabsai/misotts/blob/main/README.md Executes the main inference script for Miso TTS. This command loads the public model from Hugging Face and saves the output to full_conversation.wav. ```bash uv run python run_misotts.py ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.