Closed craigmccauley closed 5 days ago
I'm trying to get this working in my blazor wasm application so I'm using the javascript library.
The problem is, the success message fires before the talking is completed.
function talkToUser(subscriptionKey, region, textToSpeak) { var sdk = window.SpeechSDK; var speechConfig = sdk.SpeechConfig.fromSubscription(subscriptionKey, region); var synthesizer = new sdk.SpeechSynthesizer(speechConfig); synthesizer.speakTextAsync( textToSpeak, function (result) { if (result.reason === sdk.ResultReason.SynthesizingAudioCompleted) { // success window.dotNetObject.invokeMethodAsync('TalkToUserCompleted'); } else { console.error("Speech synthesis canceled, " + result.errorDetails); } // success synthesizer.close(); synthesizer = undefined; }, function (err) { // error console.error(err); synthesizer.close(); synthesizer = undefined; } ); }
Hi, please see https://github.com/Azure-Samples/cognitive-services-speech-sdk/issues/1374
I'm trying to get this working in my blazor wasm application so I'm using the javascript library.
The problem is, the success message fires before the talking is completed.