Text to Speech
Get batch item audio
Download the audio of one batch item by its ref.
GEThttps://api.voice.wistfare.com/v1/batches/{id}/items/{ref}/audio
Returns the audio bytes of one item, in the format the item asked for (audio/mpeg or audio/wav). This is the audio_url of a succeeded item in GET /v1/batches/{id}. Read-only keys can call it.
from wistfareai import WistfareAI
client = WistfareAI() # reads WISTFARE_API_KEY
audio = client.text_to_speech.batches.audio("batch_4d81f7", "welcome")
with open("welcome.mp3", "wb") as f:
f.write(audio)Path parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The batch id, batch_…. |
ref | string | The item's ref. |
Response
200 OK with the audio bytes. Audio is kept for 30 days after the batch was created.
Errors
| Status | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing, invalid or revoked API key. |
404 | not_found | Unknown batch or ref, or the item hasn't succeeded (yet). |