Skip to content

How to call multiple voice in SSML

szhaomsft edited this page Mar 13, 2020 · 14 revisions

Standard voice

customer may want to use multiple voice in one SSML. To do that, here is an example:

<speak version="1.0" xmlns="https://www.w3.org/2001/10/synthesis" xml:lang="en-US"> <voice name="en-US-AriaNeural"> This is the text that is spoken. </voice> <voice name="en-US-GuyNeural"> This is the text that is spoken. </voice> </speak>

then everything is the same like SSML with single voice

Custom voice

For customer voice, currently the endpoint to call needs to have the custom voice deployment id.

https://docs.microsoft.com/bs-latn-ba/azure/cognitive-services/speech-service/regions#custom-voices

to access multiple voice in the SSML, the endpoint also need to have multiple deployment IDs.

https://eastasia.voice.speech.microsoft.com/cognitiveservices/v1?deploymentId=id1&&deploymentId=id2&&deploymentId=id3

if there are too many voices, it is recommended to have some code to construct the URL dynamically based on the SSML content.

Clone this wiki locally