Generate speech
wellsaid_generate_speechGenerate speech audio from text using a specified WellSaid voice and save it to disk, with optional prosody controls for pitch, tempo, and loudness.
Instructions
Convert text to speech with a WellSaid voice and save it to disk. Synchronous. Text is limited to 1000 characters (any AI Director markup counts). Optional prosody (pitch/tempo/loudness) wraps the text in AI Director tags and uses the 'caruso' model — when you pass these, the text is treated as literal (special characters escaped), so don't also hand-author inline tags in the same call. For hand-authored inline tags (e.g. ), leave pitch/tempo/loudness unset. Get a speaker_id from wellsaid_list_voices first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | Text to speak. May contain inline AI Director tags (caruso model). | |
| model | No | Model to use (default legacy; caruso enables AI Director). | |
| pitch | No | AI Director pitch, roughly [-45, 100]. Forces the caruso model. | |
| tempo | No | AI Director tempo, roughly [0.7, 2.3]. Forces the caruso model. | |
| format | No | Output format (default mp3). | |
| filename | No | Output filename (extension added if missing). Defaults to a slug of the text. | |
| loudness | No | AI Director loudness, roughly [-15, 9]. Forces the caruso model. | |
| output_dir | No | Directory to write into. Defaults to WELLSAID_OUTPUT_DIR or ./output. | |
| speaker_id | Yes | Voice speaker_id from wellsaid_list_voices. | |
| embed_audio | No | Also return the audio inline (base64). Off by default. | |
| library_ids | No | Replacement-library ids to apply. | |
| sample_rate | No | Sample rate in Hz (e.g. 24000, 44100). |