---
title: "Converts text to speech"
method: POST
path: "/Template/ConvertTextToSpeech"
tags: ["Template"]
---

# Converts text to speech

`POST /Template/ConvertTextToSpeech`

<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

- ConvertTextToSpeechRequest
  - `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)

## Response `200`

Success

- ConvertTextToSpeechResponse
  - `fileUrl` string, nullable — File url to the converted and uploaded audio (signed)
  - `objKey` string, nullable — Object key of the saved TTS file, to be saved in lesson.json

---

[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)
