task icon Task

Generate Speech

3
instruction icon Tell the user the audio was generated and where it's saved. Offer to regenerate with a different voice or settings.
                    To run this task you must have the following required information:

> Text to convert to speech. Voice ID (run task:media.audio.voices first if unknown). Optionally: model ID, output format.

If you don't have all of this information, exit here and respond asking for any extra information you require, and instructions to run this task again with ALL required information.

---

You MUST use a todo list to complete these steps in order. Never move on to one step if you haven't completed the previous step. If you have multiple read steps in a row, read them all at once (in parallel).

Add all steps to your todo list now and begin executing.

## Steps

1. [Read Audio Generation Rules]: Read the documentation in: `./skills/sauna/[skill_id]/resources/context/media.audio.rules.md` (Load guidance for voice selection and TTS)

2. [Gather Arguments: Text to Speech] The next step has the following requirements for arguments, do not proceed until you have all the required information:
- `text`: the text to convert to speech
- `voiceId`: voice ID to use
- `modelId` (default: "eleven_multilingual_v2"): model ID if specified, otherwise eleven_multilingual_v2
- `outputFormat` (default: "mp3_44100_128"): output format if specified, otherwise mp3_44100_128

3. [Run Code: Text to Speech]: Call `run_script` with:

```json
{
  "file": {
    "path": https://sk.ills.app/code/media.audio.tts/preview,
    "args": [
      "text",
      "voiceId",
      "modelId",
      "outputFormat"
    ]
  },
  "packages": null
}
```

4. Tell the user the audio was generated and where it's saved. Offer to regenerate with a different voice or settings.