diff options
| author | historia <historiavg@proton.me> | 2026-08-18 17:58:04 -0400 |
|---|---|---|
| committer | historia <historiavg@proton.me> | 2026-08-18 17:58:04 -0400 |
| commit | e56754498f1c6b2a9dabb62529f783e73fae8e6b (patch) | |
| tree | 20ea86a16d6c51c4bfd793cea56fd76ae9985671 /README.md | |
| parent | 50f1825f05972e3685c55beb10c288899959b2e5 (diff) | |
| download | tts-audiobook-generator-e56754498f1c6b2a9dabb62529f783e73fae8e6b.tar.gz | |
feat: language parameter for potential accent tuning
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 38 |
1 files changed, 23 insertions, 15 deletions
@@ -9,7 +9,7 @@ This builds upon [WhiskeyCoder/Qwen3-Audiobook-Converter](https://github.com/Whi The converter sends text extracted from your books to a locally running Qwen3-TTS server and assembles the returned audio into a single audiobook file. - Input: `.txt`, `.pdf`, or `.epub` -- Output: `.mp3`, `.m4b`, `.ogg`, or `.flac` +- Output: `.m4b`, `.mp3`, `.ogg`, or `.flac` - Output a single file or one per chapter - Automatic metadata (title/artist/album tags, chapter track numbers) and a generated cover - Two voice modes: @@ -49,7 +49,7 @@ pip install -r requirements.txt ## Running the Qwen-TTS server -The converter script talks to a Qwen3-TTS Gradio server that is run using `qwen-tts-demo`. Add `--no-flash-attn` if FlashAttention isn't installed (see below). The script expects the custom voice model and base model to be on different ports depending on which you're using: +The converter script talks to a Qwen3-TTS Gradio server that is run using `qwen-tts-demo`. Add `--no-flash-attn` if FlashAttention isn't installed (see below). The script expects the custom voice model and base model to be on different ports depending on which you're using. The model(s) will automatically download. ### Custom voice @@ -69,12 +69,10 @@ qwen-tts-demo Qwen/Qwen3-TTS-12Hz-1.7B-Base --ip 127.0.0.1 --port 7861 Put your book files (epub, etc.) in the `input/` folder. Then run the script. The output goes to `output/`. -If a book's output files already exist in `output/`, you are asked at startup whether to reconvert and overwrite them; answer `n` to skip that book. All questions are asked before conversion begins, so the run is unattended once started. - ### Custom voice ```bash -python audiobook_converter.py +python audiobook.py ``` Edit `converter/config.py` to change which built-in voice is used. @@ -88,22 +86,24 @@ CUSTOM_VOICE_INSTRUCT = "Speak naturally and clearly, as if reading a dramatic b ### Voice clone ```bash -python audiobook_converter.py --voice-clone --voice-sample path/to/reference.wav +python audiobook.py --clone path/to/reference.wav ``` The reference `.wav` should be ~10-15 seconds (3 second minimum, 60 second maximum; ~15 seconds is ideal). Longer is **not** better. -Whisper (`faster_whisper` or `whisper`) is used automatically to transcribe the reference audio; without a Whisper backend it falls back to x-vector-only cloning. Override with `--voice-sample-text "..."` or skip transcription with `--no-transcription`. +Whisper (`faster_whisper` or `whisper`) is used automatically to transcribe the reference audio. Without a Whisper backend it falls back to x-vector-only cloning. Override with `--transcription "..."` or skip transcription with `--no-transcription`. -### Options +## Options -| Flag | Description | -| ----------------------------- | ----------------------------------------------------------------------------------------------------- | -| `--speed <n>` | Playback speed, pitch-preserving (`1.0` = normal). A normal-speed copy is also output. | -| `--format {mp3,m4b,ogg,flac}` | Output format (default `mp3`). `m4b` uses AAC audio and has built-in chapters. | -| `--single-file` | Not m4b: Merge all chapters into a single file (default: one file per chapter). | -| `--voice-sample-text "..."` | Override whisper auto-transcription with your own manual reference audio transcript. Not required. | -| `--no-transcription` | Skip auto-transcription of the reference audio. Usually worse, but can give a different voice affect. | +| Flag | Description | +| ----------------------------- | ------------------------------------------------------------------------------------------ | +| `--clone <path>` | Reference audio (WAV) for voice cloning. Passing this flag switches to voice clone mode. | +| `--transcription "..."` | Override whisper auto-transcription with your own manual reference audio transcript. | +| `--no-transcription` | Skip auto-transcription of the reference audio. | +| `--speed <n>` | Playback speed, pitch-preserving (`1.0` = normal). A normal-speed copy is also output. | +| `--format {mp3,m4b,ogg,flac}` | Output format (default `m4b`). `m4b` uses AAC audio and has built-in chapters. | +| `--single-file` | Not m4b: Merge all chapters into a single file (default: one file per chapter). | +| `--language <lang>` | Output language for the synthesized speech. Can add an accent even if the text is English. | ## Running tests @@ -133,6 +133,14 @@ Official wheels: https://github.com/Dao-AILab/flash-attention/releases (pick `cp Third-party wheels: https://mjunya.com/flash-attention-prebuild-wheels/ (hosted at https://github.com/mjun0812/flash-attention-prebuild-wheels). +## Tips + +Transcription affects the output a lot. Whisper is okay, but does not give perfect transcription. A manual transcription passed `--transcription` is usually better. + +Manual transcription, imperfect whisper transcription, and `--no-transcription` each provide different results. Usually the most accurate transcription is the best, but sometimes `--no-transcription` can produce a flat tone that might be preferable for certain voices. + +Setting `--language` to the "wrong" language for English text can produce an accent. It is not as strong as cloning a voice with the desired accent. + ## License MIT |
