ReadRealm turns any book in the catalog into spoken audio using Azure Cognitive Services. You can stream a full book as audio directly from the API, or engage in a real-time voice conversation powered by Azure’s realtime speech model. Voice features make ReadRealm useful for commuters, people with visual impairments, and anyone who wants to listen rather than read.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/aliammari1/readrealm/llms.txt
Use this file to discover all available pages before exploring further.
Stream audio by title
GET a continuous audio stream for any book — no download required.
Generate audio from text
POST book text directly to get back an MP3 audio response.
Real-time speech
Two-way voice interaction using a WebSocket connection and Azure realtime API.
Accessibility
Designed for hands-free reading and listeners with visual impairments.
Streaming audio by title
The quickest way to listen to a book is to call the TTS stream endpoint with the book’s title. ReadRealm looks up the book on Project Gutenberg, fetches its full text, and pipes the audio back to you as a continuous MP3 stream.| Header | Value |
|---|---|
Content-Type | audio/mpeg |
Transfer-Encoding | chunked |
Cache-Control | no-cache |
Content-Disposition | inline |
TTS requires the book to have plain-text content available on Project Gutenberg. If no text is found, the API returns a 404 with
"No text content available for this book".Generating audio from text
You can also send your own text content and receive synthesized audio back. This is useful when you want to listen to a passage, a review, or any custom text.textData field is used for audio generation. The other fields are required by the schema but do not affect the output.
If textData is empty, a default book is used. The voice used for synthesis is Alloy (an Azure OpenAI voice), and audio is encoded as MP3. Text is processed in chunks of up to 4,096 characters.
Response: A readable audio stream (audio/mpeg).
How audio streaming works
Fetch book text
ReadRealm retrieves the book’s plain-text content from Project Gutenberg using the book title. The text is cleaned — line breaks normalized, extra spaces removed — before being sent to Azure.
Send to Azure
The text is sent to Azure OpenAI’s TTS API using the
alloy voice and mp3 response format. Text longer than 4,096 characters is chunked before processing.Pipe the audio stream
The API streams the audio response directly to your client using chunked transfer encoding. The
Content-Type is audio/mpeg so any audio player or <audio> element can consume it.Real-time speech
ReadRealm includes a two-way real-time voice interface powered by Azure’s realtime speech model. Connect via WebSocket to start a session where you can speak and receive both transcript and audio responses back live.Connecting
Starting a session
Send astart event with a system message (instructions for the AI) and a temperature value:
sessionStatus event confirming the session is active.
Sending audio
Send audio chunks as base64-encoded strings:Stopping a session
sessionStatus event with { active: false }.
Real-time events reference
Events you send
| Event | Payload | Description |
|---|---|---|
start | { systemMessage, temperature } | Start a new speech session |
sendAudio | { audio: string } | Send a base64 audio chunk |
stop | — | End the session |
Events you receive
| Event | Payload | Description |
|---|---|---|
connectionStatus | { connected: true } | Emitted on initial connection |
sessionStatus | { active: boolean } | Session started or stopped |
transcript | string | Live text transcription of speech |
audio | string (base64 delta) | Audio response chunk from AI |
state | InputState | Session ready state |
error | string | Error message |
Use cases
| Use case | Feature to use |
|---|---|
| Commuting — listen to a full book | GET /book/tts/stream/{title} |
| Accessibility — hands-free reading | GET /book/tts/stream/{title} or POST /book/ebook |
| Interactive reading assistant | Real-time speech WebSocket |
| Listen to a specific passage | POST /book/ebook with custom textData |