Change languag of text to speech

Question:

I want to change the voice of azure from python, with these characteristics

languageCode = 'es‑MX'
ssmlGender = 'FEMALE' 
voicName = 'es‑MX‑DaliaNeural'

but i’m new to azure so i don’t know how, this is my code:

import PyPDF2
import azure.cognitiveservices.speech as sdk

key = "fake key"
region = "fake region"

config = sdk.SpeechConfig(subscription=key, region=region)
synthesizer = sdk.SpeechSynthesizer(speech_config=config)

book = open("prueba.pdf", "rb")
reader = PyPDF2.PdfFileReader(book)

for num in range(0,reader.numPages):
    text = reader.getPage(num).extractText()

result = synthesizer.speak_text_async(text).get()
Asked By: Steve

||

Answers:

Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.