Convert text to speech with Azure AI Speech
Having various types of messages in a bot conversation can significantly improve user engagement. You can convert text to audio and send it as an audio file message in a bot conversation. This can be done using the bot variables and Azure AI Speech integration.
Step 1. Add and set up Azure AI Speech integration:
Navigate to the organization integrations section:
Add the Azure Cognitive Services Speech (Azure AI Speech) integration:
Follow the Prerequisites section of the documentation to obtain the API key and Region, that need to be entered in the integration configuration, and click Save:
Given the settings are correct, the status of the integration will become Active.
Please note that we’re currently using those voices for the conversion: en-US-RyanMultilingualNeural for the male voice and en-US-JennyMultilingualV2Neural for the female voice. The set of the supported Azure regions is currently limited to East US, West Europe, and Southeast Asia. Check the status of the language region support here (see Jenny Multilingual V2 and Ryan Multilingual).
Step 2. Add bot variable of type Text to Speech:
In our example, we use another variable text for the conversion, so you will need to change it according to your bot structure.
Select the previously configured integration.
Step 3. Add a chat text of type Audio File to render the audio
Enable custom file URL and use the previously created variable, and adjust other settings as needed.