# StreamElements TTS

> Read text aloud in StreamElements' voices (including Brian, the voice of Twitch donation alerts) and save it as an MP3 your workflow can play or send.

App · Video & Audio · 2 actions. Web page: https://docs.lodol.com/docs/integrations/streamelements-tts

## Actions

### Find voices

Look up which StreamElements voices speak a language, optionally narrowed to one gender. Use it when the language isn't known until the workflow runs: reading a viewer's message back in their own language, for example. The first match also comes back on its own as 'voice_id', ready to drop straight into Speak text.

**Inputs**

- Language (`language_code`, text): Only return voices that speak this language. Leave empty for every voice.
- Gender (`gender`, text): Only return voices of this gender. Leave empty for both. One of: `Female`, `Male`.

**Outputs**

- `count` (number)
- `gender` (text)
- `language` (text)
- `language_code` (text)
- `voice_id` (text)
- `voice_name` (text)
- `voices` (list)

**Example output**

```json
{
  "count": 2,
  "gender": "Male",
  "language": "English (UK)",
  "language_code": "en-GB",
  "voice_id": "Ali",
  "voice_name": "Ali",
  "voices": [
    {
      "gender": "Male",
      "id": "Ali",
      "language": "English (UK)",
      "language_code": "en-GB",
      "name": "Ali"
    },
    {
      "gender": "Male",
      "id": "Brian",
      "language": "English (UK)",
      "language_code": "en-GB",
      "name": "Brian"
    }
  ]
}
```

### Speak text

Read a line of text aloud in one of StreamElements' voices and save it as an MP3. The action returns a download URL and a document reference, so a later step can play it on an overlay, post it to chat, send it, or attach it to a message.

**Inputs**

- Voice (`voice`, text, required): The voice to read the text in. Search the list by name, by language or by gender.
- Text (`text`, text, required): What to say, up to 1000 characters.

**Outputs**

- `byte_size` (number)
- `character_count` (number)
- `content_type` (text)
- `document_ref` (text)
- `documents` (list)
- `text` (text)
- `url` (text)
- `voice` (text)

**Example output**

```json
{
  "byte_size": 14336,
  "character_count": 22,
  "content_type": "audio/mpeg",
  "document_ref": "doc_4c1f7a2b9e0d5a63",
  "documents": [
    {
      "content_type": "audio/mpeg",
      "document_ref": "doc_4c1f7a2b9e0d5a63",
      "filename": "streamelements-brian.mp3",
      "size_bytes": 14336,
      "url": "/actions/core/serve-document/doc_4c1f7a2b9e0d5a63?teamId=6512a1b2c3d4e5f600000001"
    }
  ],
  "text": "Thanks for the follow!",
  "url": "/actions/core/serve-document/doc_4c1f7a2b9e0d5a63?teamId=6512a1b2c3d4e5f600000001",
  "voice": "Brian"
}
```
