How to Turn Any Book into a Multi-Voice Audio Production with Alexandria
A familiar situation: you find a cool book or fanfic that you want to "devour" in one evening, but there's simply no time to sit down and read. Regular "readers" with synthetic voices sound like robots from the eighties, and professional audiobooks cost money or simply don't exist for rare works. Recently I stumbled upon the Alexandria project, which solves this problem at a near-studio level.
What It Is
Alexandria is not just another text-to-speech script. It's a full-fledged pipeline that takes your text file and turns it into a formatted script. The system understands on its own where the narrator speaks and where the characters do, assigning each a unique voice. It runs on the Qwen3-TTS engine, which can convey emotions, make pauses, and even imitate sighs or laughter.
The main highlight is that the project combines the capabilities of large language models (LLM) for text analysis and modern neural networks for speech synthesis. You get not monotonous mumbling, but a full-fledged audio performance.
How the Process Works
Working with the tool is broken down into logical stages. I liked that the developer doesn't force you to mess with the console — there's a perfectly usable web interface.
Script Annotation via LLM
First, you feed the book to the program. Alexandria connects to your local LLM (via Ollama or LM Studio) or to the OpenAI API. The neural network analyzes the text and converts it into a JSON structure. It extracts dialogues, identifies the speaker, and, coolest of all, writes voice instructions. For example: "Marcus says this with threatening confidence, in a low, insidious voice."
Working with Voices
After annotation, you land in the voice management section. For each character found, you can choose one of nine presets or go further:
- Cloning: upload a 10-second audio sample, and the character will speak with that voice.
- Voice Design: you can simply describe the voice in text, for example: "A warm voice of an elderly woman with a slight rasp," and the neural network will create it from scratch.
- LoRA Training: for those who want the perfect result, there's an option to fine-tune the model on a specific dataset right in the interface.
Editor and Export
Before final assembly, you can listen to each segment separately. If the neural network made a mistake with the intonation somewhere, you simply edit the text instruction and regenerate that specific piece. The output is either a single MP3/M4B file with chapters, or a project for Audacity where each voice is on a separate track. This is convenient if you want to add background music or effects manually.
The Technical Side
The project is written in Python and requires fairly powerful hardware if you want to generate audio quickly.
- Minimum: 8 GB of video memory (VRAM). This is enough for working line by line.
- Recommended: 16 GB and above. Then you can enable batch processing, which speeds up the process by 3-6 times.
- Optimization:
torch.compileis supported, which gives a noticeable speed boost on NVIDIA and AMD cards (on Linux).
Interestingly, the author included Pinokio support — this is a browser for AI applications that automatically installs all dependencies, environments, and libraries. For those who don't want to deal with pip install and version conflicts, this is a lifesaver.
Practical Benefits
Why would a developer need this? Besides the obvious "make an audiobook from documentation," there are a couple of interesting use cases:
- Voice prototyping for games: you can quickly sketch out dialogues and listen to how they sound performed by different characters without hiring actors at early stages.
- Content creation: if you run a podcast or YouTube channel, Alexandria will help create quality segments with different voices.
- Automation: the project has a REST API. You can integrate voice generation into your pipelines.
Is It Worth Trying
If you have a graphics card at the level of RTX 3060 or higher, then definitely yes. Alexandria is one of the most well-thought-out tools in its niche. It doesn't just "read text" — it tries to understand the context and emotions of the work.
On the downside: the project is quite heavy. On the first install, it will download about 20 GB of data (libraries + model weights). Also keep in mind that a good LLM is needed for quality text annotation — small models with 3-7 billion parameters may get confused about characters.
Overall, it's a great example of how neural networks are turning from fun toys into genuinely useful tools for everyday tasks. You can try it locally or via Google Colab if you don't have enough hardware of your own.
Related projects