Adding reference to the SDK issue as answer to help other members of the community. Thanks!!
How to get blendshapes from SSML
Dexin Huang
5
Reputation points
I am using the following code, however, I cannot retrieve the JSON string that is supposed to be able to drive blendshapes.
private System.Collections.IEnumerator SpeakAsync(string response){ var startTime = DateTime.Now; var speechSynthesisVoiceName = "en-US"+"-"+voice+"Neural";
var ssml = @$"<speak version='1.0' xml:lang='en-US' xmlns='http://www.w3.org/2001/10/synthesis' xmlns:mstts='http://www.w3.org/2001/mstts'> <voice name='{speechSynthesisVoiceName}'> <mstts:viseme type='FacialExpression'/> {response} </voice></speak>";
synthesizer.VisemeReceived += (s, e) =>{ Debug.Log($"Viseme event received. Audio offset: " + $"{e.AudioOffset / 10000}ms, viseme id: {e.VisemeId}.{e.Animation}"); // `Animation` is an xml string for SVG or a json string for blend shapes var animation = e.Animation; blendShapeDictionary = JsonUtility.FromJson<Dictionary<string, float>>(animation);
1 answer
Sort by: Most helpful
-
romungi-MSFT 48,766 Reputation points Microsoft Employee
2023-01-30T14:29:43.2633333+00:00