Convert PDFs, EPUBs, DOCX, DOC, and TXT files into high-quality audiobooks using **Qwen3 TTS Voice Model** - an open-source voice synthesis system that excels at natural speech generation and voice cloning.
Python
1,106
15 commits
updated Apr 7, 2026
Convert PDFs, EPUBs, DOCX, DOC, and TXT files into high-quality audiobooks using Qwen3 TTS Voice Model - an open-source voice synthesis system that excels at natural speech generation and voice cloning.
🎧 Sample Output
Listen to the T-Rex: Download audioNo it's not broken, it's a raw mp3 file download it and play it, you can't embedded audio in a readme.md GitHub whenthe sample is on GitHub
http://127.0.0.1:7860Clone the repository:
git clone https://github.com/WhiskeyCoder/Qwen3-Audiobook-Converter.git
cd Qwen3-Audiobook-Converter
Install Python dependencies:
pip install -r requirements.txt
Install FFmpeg:
choco install ffmpegsudo apt-get install ffmpegbrew install ffmpegStart Qwen Voice Model:
http://127.0.0.1:7860Add your books:
# Place your books in the book_to_convert folder
cp your_book.pdf book_to_convert/
Run the converter:
# Default: Custom Voice mode (Ryan speaker, English)
python audiobook_converter.py
# Voice Clone mode with automatic transcription
python audiobook_converter.py --voice-clone --voice-sample path/to/reference.wav
gradio_client>=0.7.0
requests>=2.28.0
PyPDF2>=3.0.0
ebooklib>=0.18
pydub>=0.25.1
python-docx>=0.8.11
docx2txt>=0.8
beautifulsoup4>=4.11.0
The converter uses optimized hardcoded settings for best audiobook quality:
book_to_convert/audiobooks/Uses the pre-built Ryan speaker with optimized audiobook narration style. Best for most use cases.
python audiobook_converter.py
Available Speakers (can be changed in code):
Ryan - Male, clear and professional (default)Serena - Female, warm and friendlyAiden - Male, energeticDylan - Male, calmEric - Male, expressiveOno_anna - Female, Japanese accentSohee - Female, Korean accentUncle_fu - Male, Chinese accentVivian - Female, versatileClone a specific voice from a reference audio file. The reference audio is automatically transcribed using Qwen's Whisper model.
python audiobook_converter.py --voice-clone --voice-sample path/to/reference.wav
Requirements:
| Setting | Value | Description |
|---|---|---|
CHUNK_SIZE_WORDS | 1200 | Words per processing chunk |
MAX_WORKERS | 1 | Concurrent chunks (keep at 1 to avoid rate limiting) |
AUDIO_FORMAT | mp3 | Output format |
AUDIO_BITRATE | 128k | Audio quality |
MAX_RETRIES | 3 | Retry attempts for failed chunks |
| Format | Extension | Status |
|---|---|---|
| Plain Text | .txt | ✅ Full support |
.pdf | ✅ Full support | |
| EPUB | .epub | ✅ Full support |
| Word Document | .docx | ✅ Full support (requires python-docx) |
| Legacy Word | .doc | ✅ Full support (requires docx2txt) |
# Place your book in the input folder
cp "my_book.pdf" book_to_convert/
# Run the converter
python audiobook_converter.py
# Output will be in: audiobooks/my_book.mp3
# Add multiple books
cp *.pdf book_to_convert/
cp *.epub book_to_convert/
# Convert all at once
python audiobook_converter.py
# Clone a voice from reference audio
python audiobook_converter.py \
--voice-clone \
--voice-sample "reference_audio.wav"
The reference audio will be automatically transcribed, so you don't need to provide the text manually.
qwen-audiobook-converter/
├── audiobook_converter.py # Main conversion script
├── requirements.txt # Python dependencies
├── README.md # This file
├── LICENSE # MIT License
├── .gitignore # Git ignore rules
├── book_to_convert/ # 📚 Input folder (place books here)
├── audiobooks/ # 🎧 Output folder (audiobooks saved here)
├── chunks/ # ⚡ Temporary processing files (auto-cleaned)
├── cache/ # 💾 Cached audio chunks
│ └── audio_chunks/
└── logs/ # 📊 Processing logs
└── audiobook_YYYYMMDD.log
[ERROR] Cannot connect to Qwen API!
Solutions:
curl http://127.0.0.1:7860/QWEN_API_URL in the code matches your server[ERROR] Configuration Error! Voice Clone mode requires a reference audio file.
Solutions:
--voice-sample points to a valid WAV file[ERROR] No text extracted from document
Solutions:
Solutions:
~{chunks * 4} minutes[ERROR] FFmpeg not found
Solutions:
The script automatically cleans up chunks, but if they persist:
# Manually clean up
rm -rf chunks/*.wav
To change settings like speaker, language, or chunk size, edit the hardcoded configuration at the top of audiobook_converter.py:
# Hardcoded Voice Settings
CUSTOM_VOICE_SPEAKER = "Ryan" # Change to Serena, Aiden, etc.
CUSTOM_VOICE_LANGUAGE = "English"
CHUNK_SIZE_WORDS = 1200 # Adjust chunk size
AUDIO_BITRATE = "128k" # Change to 192k or 256k for higher quality
The chunking algorithm respects sentence boundaries. To modify chunking behavior, edit the split_into_chunks method in audiobook_converter.py.
Logs are saved to logs/audiobook_YYYYMMDD.log with detailed information about:
Contributions are welcome! Please feel free to submit a Pull Request.
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)# Clone your fork
git clone https://github.com/WhiskeyCoder/qwen-audiobook-converter.git
cd qwen-audiobook-converter
# Install dependencies
pip install -r requirements.txt
# Make your changes
# Test thoroughly
# Submit PR
This project is licensed under the MIT License - see the LICENSE file for details.
Qwen-API.md for detailed API documentationIf you find this project useful, please consider giving it a star! ⭐
Made with ❤️ for the audiobook community
121 followers · starred Jan 2026
379 followers · starred Jul 2026
285 followers · starred Jul 2026
12 followers · starred Jul 2026
Convert PDFs, EPUBs, DOCX, DOC, and TXT files into high-quality audiobooks using **Qwen3 TTS Voice Model** - an open-source voice synthesis system that excels at natural speech generation and voice cloning.
Python
1,106
15 commits
updated Apr 7, 2026
Convert PDFs, EPUBs, DOCX, DOC, and TXT files into high-quality audiobooks using Qwen3 TTS Voice Model - an open-source voice synthesis system that excels at natural speech generation and voice cloning.
🎧 Sample Output
Listen to the T-Rex: Download audioNo it's not broken, it's a raw mp3 file download it and play it, you can't embedded audio in a readme.md GitHub whenthe sample is on GitHub
http://127.0.0.1:7860Clone the repository:
git clone https://github.com/WhiskeyCoder/Qwen3-Audiobook-Converter.git
cd Qwen3-Audiobook-Converter
Install Python dependencies:
pip install -r requirements.txt
Install FFmpeg:
choco install ffmpegsudo apt-get install ffmpegbrew install ffmpegStart Qwen Voice Model:
http://127.0.0.1:7860Add your books:
# Place your books in the book_to_convert folder
cp your_book.pdf book_to_convert/
Run the converter:
# Default: Custom Voice mode (Ryan speaker, English)
python audiobook_converter.py
# Voice Clone mode with automatic transcription
python audiobook_converter.py --voice-clone --voice-sample path/to/reference.wav
gradio_client>=0.7.0
requests>=2.28.0
PyPDF2>=3.0.0
ebooklib>=0.18
pydub>=0.25.1
python-docx>=0.8.11
docx2txt>=0.8
beautifulsoup4>=4.11.0
The converter uses optimized hardcoded settings for best audiobook quality:
book_to_convert/audiobooks/Uses the pre-built Ryan speaker with optimized audiobook narration style. Best for most use cases.
python audiobook_converter.py
Available Speakers (can be changed in code):
Ryan - Male, clear and professional (default)Serena - Female, warm and friendlyAiden - Male, energeticDylan - Male, calmEric - Male, expressiveOno_anna - Female, Japanese accentSohee - Female, Korean accentUncle_fu - Male, Chinese accentVivian - Female, versatileClone a specific voice from a reference audio file. The reference audio is automatically transcribed using Qwen's Whisper model.
python audiobook_converter.py --voice-clone --voice-sample path/to/reference.wav
Requirements:
| Setting | Value | Description |
|---|---|---|
CHUNK_SIZE_WORDS | 1200 | Words per processing chunk |
MAX_WORKERS | 1 | Concurrent chunks (keep at 1 to avoid rate limiting) |
AUDIO_FORMAT | mp3 | Output format |
AUDIO_BITRATE | 128k | Audio quality |
MAX_RETRIES | 3 | Retry attempts for failed chunks |
| Format | Extension | Status |
|---|---|---|
| Plain Text | .txt | ✅ Full support |
.pdf | ✅ Full support | |
| EPUB | .epub | ✅ Full support |
| Word Document | .docx | ✅ Full support (requires python-docx) |
| Legacy Word | .doc | ✅ Full support (requires docx2txt) |
# Place your book in the input folder
cp "my_book.pdf" book_to_convert/
# Run the converter
python audiobook_converter.py
# Output will be in: audiobooks/my_book.mp3
# Add multiple books
cp *.pdf book_to_convert/
cp *.epub book_to_convert/
# Convert all at once
python audiobook_converter.py
# Clone a voice from reference audio
python audiobook_converter.py \
--voice-clone \
--voice-sample "reference_audio.wav"
The reference audio will be automatically transcribed, so you don't need to provide the text manually.
qwen-audiobook-converter/
├── audiobook_converter.py # Main conversion script
├── requirements.txt # Python dependencies
├── README.md # This file
├── LICENSE # MIT License
├── .gitignore # Git ignore rules
├── book_to_convert/ # 📚 Input folder (place books here)
├── audiobooks/ # 🎧 Output folder (audiobooks saved here)
├── chunks/ # ⚡ Temporary processing files (auto-cleaned)
├── cache/ # 💾 Cached audio chunks
│ └── audio_chunks/
└── logs/ # 📊 Processing logs
└── audiobook_YYYYMMDD.log
[ERROR] Cannot connect to Qwen API!
Solutions:
curl http://127.0.0.1:7860/QWEN_API_URL in the code matches your server[ERROR] Configuration Error! Voice Clone mode requires a reference audio file.
Solutions:
--voice-sample points to a valid WAV file[ERROR] No text extracted from document
Solutions:
Solutions:
~{chunks * 4} minutes[ERROR] FFmpeg not found
Solutions:
The script automatically cleans up chunks, but if they persist:
# Manually clean up
rm -rf chunks/*.wav
To change settings like speaker, language, or chunk size, edit the hardcoded configuration at the top of audiobook_converter.py:
# Hardcoded Voice Settings
CUSTOM_VOICE_SPEAKER = "Ryan" # Change to Serena, Aiden, etc.
CUSTOM_VOICE_LANGUAGE = "English"
CHUNK_SIZE_WORDS = 1200 # Adjust chunk size
AUDIO_BITRATE = "128k" # Change to 192k or 256k for higher quality
The chunking algorithm respects sentence boundaries. To modify chunking behavior, edit the split_into_chunks method in audiobook_converter.py.
Logs are saved to logs/audiobook_YYYYMMDD.log with detailed information about:
Contributions are welcome! Please feel free to submit a Pull Request.
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)# Clone your fork
git clone https://github.com/WhiskeyCoder/qwen-audiobook-converter.git
cd qwen-audiobook-converter
# Install dependencies
pip install -r requirements.txt
# Make your changes
# Test thoroughly
# Submit PR
This project is licensed under the MIT License - see the LICENSE file for details.
Qwen-API.md for detailed API documentationIf you find this project useful, please consider giving it a star! ⭐
Made with ❤️ for the audiobook community
121 followers · starred Jan 2026
379 followers · starred Jul 2026
285 followers · starred Jul 2026
12 followers · starred Jul 2026