---
title: "Converts text to speech, returns a stream. AudioFormat -> 0 = \"audio/mp3\" (default), 1 = \"audio/mpeg\""
method: POST
path: "/Template/ConvertTextToSpeechStream"
tags: ["Template"]
---

# Converts text to speech, returns a stream. AudioFormat -> 0 = "audio/mp3" (default), 1 = "audio/mpeg"

`POST /Template/ConvertTextToSpeechStream`

<br>
  <i>Replaces "AVRCMSService/Common/AdminConvertTextToSpeech" service.</i>
</br>
<br>
  <b>VoiceId</b>: https://docs.aws.amazon.com/polly/latest/dg/API_Voice.html </br>
<br>Added Support for 'SSML', set isSSML to true and ensure that in 'Text', its wrapped with 'speech' tag for it to work.</br>

## Headers

- `X-Version` string

## Request body

- ConvertTextToSpeechRequest2
  - `lessonId` integer, required — Lesson identifier
  - `instituteId` integer, required — Institute identifier
  - `voiceId` integer, required — Voice (accent) identifier
  - `speechText` string, required — Text to be converted to audio
  - `isSSML` boolean — Use Speech Synthesis Markup Language (SSML) (note Text passed must include SSML syntax for it to work)
  - `audioFormat` integer

## Response `200`

Success

---

[API](https://skmtc.dev/eon-xr/apis/eonxr-api.md) · [All operations](https://skmtc.dev/eon-xr/apis/eonxr-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/eon-xr/eonxr-api/revisions/538c75161c64/schema)
