### Development install commands Source: https://github.com/aedocw/epub2tts/blob/main/README.md Commands to clone the repository, create and activate a virtual environment, install system dependencies, and install Python packages for development. ```bash #clone the repo git clone https://github.com/aedocw/epub2tts cd epub2tts #create a virtual environment python -m venv .venv #activate the virtual environment source .venv/bin/activate #install dependencies sudo apt install espeak-ng ffmpeg pip install coqui-tts --only-binary spacy pip install -r requirements.txt ``` -------------------------------- ### Install requirements Source: https://github.com/aedocw/epub2tts/blob/main/utils/README.md Runs the install_reqs.sh script to install the required dependencies for fine tuning. ```bash sh ./install_reqs.sh ``` -------------------------------- ### Docker run examples for epub2tts Source: https://github.com/aedocw/epub2tts/blob/main/README.md Examples for running a scan of 'mybook.epub' with Docker, including a CUDA-enabled variant. The first command mounts the local TTS data directory and current directory; the second uses the CUDA image with GPU support. ```bash #Example for running scan of "mybook.epub" docker run -e COQUI_TOS_AGREED=1 -v ${PWD}/.local/share/tts:/root/.local/share/tts -v ${PWD}:/root -w /root ghcr.io/aedocw/epub2tts:release mybook.epub --scan or with CUDA docker image: docker run --rm --gpus all -e COQUI_TOS_AGREED=1 -e CUDA_HOME=/usr/local/cuda -v tts:/root/.local/share/tts -v .:/root -w /root ghcr.io/aedocw/epub2tts:release-cuda12 mybook.epub --scan ``` -------------------------------- ### Docker run example for reading parts 3-15 Source: https://github.com/aedocw/epub2tts/blob/main/README.md Runs epub2tts to read parts 3 through 15 of 'mybook.epub' using the standard or CUDA Docker image. ```bash #Example for reading parts 3 through 15 of "mybook.epub" docker run -e COQUI_TOS_AGREED=1 -v ${PWD}/.local/share/tts:/root/.local/share/tts -v ${PWD}:/root -w /root ghcr.io/aedocw/epub2tts:release mybook.epub --start 3 --end 15 or with CUDA docker image: docker run --rm --gpus all -e COQUI_TOS_AGREED=1 -e CUDA_HOME=/usr/local/cuda -v tts:/root/.local/share/tts -v .:/root -w /root ghcr.io/aedocw/epub2tts:release-cuda12 mybook.epub --start 3 --end 15 ``` -------------------------------- ### Install lxml manually Source: https://github.com/aedocw/epub2tts/blob/main/README.md Run this command to install the latest version of lxml manually, then re-run `pip install .` if you encounter an error while trying to install the lxml package. ```bash pip install lxml ``` -------------------------------- ### Linux Installation Commands Source: https://github.com/aedocw/epub2tts/blob/main/README.md Install dependencies and epub2tts on Ubuntu 22.04. Requires ffmpeg and optionally CUDA toolkit for NVIDIA GPUs. If deepspeed causes errors, try installing CUDA toolkit or use --no-deepspeed. ```bash #install dependencies sudo apt install espeak-ng ffmpeg #If you have a CUDA-compatible GPU, run: sudo apt install nvidia-cuda-toolkit #clone the repo git clone https://github.com/aedocw/epub2tts cd epub2tts pip install coqui-tts --only-binary spacy pip install . ``` -------------------------------- ### Install NLTK punkt Source: https://github.com/aedocw/epub2tts/blob/main/README.md Run these two commands to install the NLTK punkt tokenizer data if you encounter a 'punkt not found' error. ```python python -c "import nltk" ``` ```python python -m nltk.downloader punkt ``` -------------------------------- ### macOS Installation Commands Source: https://github.com/aedocw/epub2tts/blob/main/README.md Install dependencies and epub2tts on macOS using Homebrew, pyenv, and pip. Requires Python 3.11 and Homebrew. Voice models are saved locally in ~/.local/share/tts. ```bash #install dependencies brew install espeak pyenv ffmpeg mecab #install epub2tts git clone https://github.com/aedocw/epub2tts cd epub2tts pyenv install 3.11 pyenv local 3.11 #OPTIONAL but recommended - install this in a virtual environment pip install coqui-tts --only-binary spacy python -m venv .venv && source .venv/bin/activate pip install . ``` -------------------------------- ### Create and activate virtual environment Source: https://github.com/aedocw/epub2tts/blob/main/utils/README.md Creates a Python virtual environment named .venv and activates it. Run this first before installing requirements. ```bash python -m venv .venv; source .venv/bin/activate ``` -------------------------------- ### Install PyTorch with CUDA support Source: https://github.com/aedocw/epub2tts/blob/main/README.md Use this command to install PyTorch with CUDA support if you encounter an error that Torch is not compiled with CUDA enabled. ```bash pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121 ``` -------------------------------- ### Run Gradio Source: https://github.com/aedocw/epub2tts/blob/main/utils/README.md Starts the Gradio interface for fine tuning using the run_gradio.sh script. ```bash sh ./run_gradio.sh ``` -------------------------------- ### Install ffmpeg via Chocolatey Source: https://github.com/aedocw/epub2tts/blob/main/README.md Rerun this command in an elevated PowerShell session, outside of the virtual environment, if ffmpeg is not found. ```powershell choco install ffmpeg ``` -------------------------------- ### XTTS with custom voice clone Source: https://github.com/aedocw/epub2tts/blob/main/README.md Use your own voice clone with XTTS. First scan the epub to determine start and end parts, then provide 1-3 30-second voice clips and specify the start/end chapters. ```bash epub2tts mybook.epub --scan ``` ```bash epub2tts my-book.epub --start 4 --end 20 --xtts voice-1.wav,voice-2.wav,voice-3.wav --cover cover-image.jpg ``` -------------------------------- ### Generate default audiobook with VITS model Source: https://github.com/aedocw/epub2tts/blob/main/README.md Generates an audiobook using the default VITS model with all defaults and no GPU required. To change the speaker, add the --speaker flag, for example '--speaker p307' for a good male voice with Coqui TTS. ```bash epub2tts mybook.epub ``` ```bash epub2tts mybook.epub --speaker p307 ``` -------------------------------- ### Extract EPUB contents to text Source: https://github.com/aedocw/epub2tts/blob/main/README.md Exports the contents of an EPUB file to a text file. After running, edit the resulting .txt file to set chapter names and remove front matter. The first two lines can be 'Title:' and 'Author:' for audiobook metadata, and the book copy must start with a chapter heading marked by a hashmark. ```bash epub2tts mybook.epub --export txt ``` -------------------------------- ### Copy fine-tuned model Source: https://github.com/aedocw/epub2tts/blob/main/utils/README.md Copies the fine-tuned model to ~/.local/share/tts/voice-TIMESTAMP. Best results with about an 8 minute audio sample. ```bash python copy_model.py ``` -------------------------------- ### Docker alias for epub2tts (Linux/macOS) Source: https://github.com/aedocw/epub2tts/blob/main/README.md Creates a shell alias to run epub2tts via Docker on Linux and macOS. Mounts the current directory and the local TTS data directory. ```bash alias epub2tts='docker run -e COQUI_TOS_AGREED=1 -v "$PWD:$PWD" -v ~/.local/share/tts:/root/.local/share/tts -w "$PWD" ghcr.io/aedocw/epub2tts:release' ``` -------------------------------- ### Generate audiobook with Edge Cloud TTS engine Source: https://github.com/aedocw/epub2tts/blob/main/README.md Generates an audiobook using the Microsoft Edge Cloud TTS engine. This service is free, requires minimal CPU, and is fast. Specify the speaker with --speaker and optionally provide a cover image and use --sayparts. ```bash epub2tts mybook.txt --engine edge --speaker en-US-AvaNeural --cover cover-image.jpg --sayparts ``` -------------------------------- ### Use model with epub2tts Source: https://github.com/aedocw/epub2tts/blob/main/utils/README.md Adds the --model flag with the model name when creating an audiobook with XTTS v2. ```bash --model my-model ``` -------------------------------- ### Generate audiobook with Kokoro engine Source: https://github.com/aedocw/epub2tts/blob/main/README.md Uses the Kokoro TTS engine for high-quality speech. Specify a speaker with --speaker; the default is 'af_sky' if not specified. The --speed flag is currently ignored. ```bash epub2tts mybook.txt --engine kokoro --speaker am_michael --speed 1.3 ``` -------------------------------- ### XTTS with Coqui Studio voice Source: https://github.com/aedocw/epub2tts/blob/main/README.md Use a Coqui Studio voice with the XTTS engine. The command specifies the engine, speaker name, cover image, and the --sayparts flag to announce part numbers. ```bash epub2tts mybook.txt --engine xtts --speaker "Damien Black" --cover cover-image.jpg --sayparts ``` -------------------------------- ### List available Edge TTS voices Source: https://github.com/aedocw/epub2tts/blob/main/README.md Lists available voices for the Microsoft Edge Cloud TTS engine. The default speaker is 'en-US-AndrewNeural' if --speaker is not specified. ```bash edge-tts --list-voices ``` -------------------------------- ### Disable deepspeed Source: https://github.com/aedocw/epub2tts/blob/main/README.md Add this flag to your command to disable deepspeed if it is detected but not working properly, causing errors. ```bash --no-deepspeed ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.