Hello,
I'm new to here Azure. And I only want to use the text to speech function with Azure.
I've follow the tour how-to-speech-synthesis to write the code. And everything looks fine. But the broswer only sound up once. I've try to change the config and location of the service but failed still.
what's more, there are no any error in F12. So it confuse me a lot. And don't know what to do.
In Addition, I'm using global Azure in China for free account. the last service has been set to South Korea. Is it problem in net? I'm getting more confused with the code has worked well for once.
PPPPPPPPPPPPPPPPPPPPPPPPPlase help me. Thanks a lot.
here is the code.
function synthesizeSpeech() {
const speechConfig = SpeechSDK.SpeechConfig.fromSubscription("***", "koreacentral");
// Set either the `SpeechSynthesisVoiceName` or `SpeechSynthesisLanguage`.
speechConfig.speechSynthesisLanguage = "zh-CN";
// speechConfig.speechSynthesisVoiceName = "zh-CN-YunyeNeural";
const audioConfig=SpeechSDK.AudioConfig.fromDefaultSpeakerOutput();
const synthesizer = new SpeechSDK.SpeechSynthesizer(speechConfig, audioConfig);
synthesizer.speakTextAsync(
t,
result=>{
if(result){
synthesizer.close();
return result.audioData;
}
},
error=>{
console.error(error);
synthesizer.close();
}
)
}
t=some Chinese characters
;