> For the complete documentation index, see [llms.txt](https://docs.stackai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stackai.com/guides-and-quickstarts/workflow-builder/audio-input-and-output.md).

# Audio input and output

Text-to-speech converts written content into audio. Speech-to-text converts audio into written content. Use either action on its own or connect them to other workflow steps.

{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSQ1Sgy933krTyK0S4JpP%2Fuploads%2FkRKu7X8AOfKk4u34Tmc2%2FG028.mp4?alt=media&token=fc8ed717-a4bd-44e2-b86d-b39b19f771b5>" %}

## Before you start

Have an authorized connection for the speech provider you want to use.

## Connect the audio steps

Inspect the connections between text input, speech generation, transcription, and output.

![Text input, speech generation, transcription, and output path](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/QXQSLlMVN7OvqnZitcxm/assets/g028-g028-01-canvas.png)

Each action must receive the data type it expects from the preceding step.

## Generate speech

In Text to Speech, select the connection, voice, and speech model, then reference the input text.

![Text to Speech connection, voice, model, and input](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/jaBVdulGk9nLaR2gWucD/assets/g028-g028-02-speech-settings.png)

Available voices and models depend on the provider and account.

## Transcribe audio

In Speech to Text, map Audio URL to the generated audio's Signed URL.

![Generated Signed URL mapped into Speech to Text](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/D45k64XJlEDvoOLZ0mVr/assets/g028-g028-03-audio-reference.png)

This passes the audio created during the current run into transcription.

Run the workflow and inspect the transcription.

![Transcription result compared with the input text](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/tV5v9pRbdraHKY2BhCh4/assets/g028-g028-04-result.png)

Compare its meaning with the original text, allowing for differences such as number formatting and punctuation.

## Important behavior

Text to Speech and Speech to Text can be used independently. Connect them only when you need to transcribe generated speech.

Signed audio URLs can expire. If audio cannot be retrieved, supply a current, accessible URL.

## Related steps

* [Create and manage connections](/guides-and-quickstarts/using-tools-and-actions/create-and-manage-connections.md)
* [Configure and test an action](/guides-and-quickstarts/using-tools-and-actions/configure-and-test-an-action.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.stackai.com/guides-and-quickstarts/workflow-builder/audio-input-and-output.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
