Speech SDK SpeechSynthesisVisemeEventArgs.Animation is always empty

Amyyra 0 Reputation points
2023-07-01T23:23:49.2933333+00:00

I have the following code:

using (var synthesizer = new SpeechSynthesizer(speechConfig, null))
{
    // Subscribes to viseme received event
    synthesizer.VisemeReceived += (s, e) =>
    {
        console.writeLine(e.Animation);
    };

    var result = await synthesizer.SpeakSsmlAsync(ssml);
}


My ssml variable is as follows (My resource is on the "eastus" region and I'm using the voice "en-US-JaneNeural"):

<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xmlns:mstts="http://www.w3.org/2001/mstts" xml:lang="en-US">
  <voice name="en-US-JaneNeural">
    <mstts:viseme type="FacialExpression"/>
  </voice>
</speak>

The SpeechSynthesisVisemeEventArgs.Animation is always an empty string. I have tried different regions for the resource and different voices. I have also made sure that the <mstts:viseme type="FacialExpression"/> is in the ssml request, but the animation is always empty.

Is there any other setting I have to change or how can I get the BlendShapes data?

Azure AI Speech
Azure AI Speech
An Azure service that integrates speech processing into apps and services.
1,867 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Amyyra 0 Reputation points
    2023-07-04T21:32:06.95+00:00

    In the mean time, I found the real problem: I was saving the event.animation in a list which had a limit and disregarded the last few events received (by mistake).

    Now it turns out that these last few events have all the blendshape Information and I falsely checked only the first half of the ones that I received. I modified my code to save all events.

    It now works properly.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.