cognitive-services-speech-sdk: Visemes received from SpeechSynthesizer.VisemeReceived do not match animation

Please synthesize the word “STRAW” using your .NET SDK by calling speechSynthesizer.SpeakSsmlAsync() being sure to include the element <mstts:viseme type=“redlips_front”/>per your documentation. That will return a SpeechSynthesisVisemeEventArgs with an SVG animation. Also, make sure to add a handler to the SpeechSynthesizer.VisemeReceived event so that you can retrieve the associated visemes.

The animation received looks pretty good. I’ve attached 2 versions of it, one from a male and female voice. Both are very similar. If you look at either SVG, you’ll see that there are 7 different mouth positions represented. Here’s a snippet from the SVG for “front_upper_mouth”:

<path d="M 309,544.07 C 300.82,547.75 281,556.75 281,557 C 281,557.25 284.16,557 285,557 C 285.85,557 334.49,557 350.68,557 C 366.87,557 408.54,555.63 421.82,555.63 C 435.09,555.63 473.42,554.47 497.32,554.47 C 521.22,554.47 575.86,557 600.24,557 C 624.62,557 682.83,553.55 709.74,553.55 C 736.64,553.55 768.05,555.63 779,555.63 C 789.95,555.63 840.67,557 850,557 C 856.89,557 914.03,557 915,557 C 915.97,557 918.72,557.16 918.72,557 C 918.72,556.37 898.73,546.79 893,544.07 C 887.27,541.36 763.02,489.72 742.08,480.68 C 721.15,471.63 704.68,466.11 682.27,458.90 C 659.87,451.68 640.94,450.79 627.43,453.73 C 613.93,456.67 604.30,468.11 601,468.11 C 597.70,468.11 588.71,458.90 573.48,454.33 C 558.26,449.77 530.47,455.96 520.09,458.90 C 509.71,461.83 496.57,466.86 467.52,478.58 C 438.48,490.30 317.18,540.40 309,544.07 Z" id="front_upper_mouth" fill="#E08787"> <animate attributeName="d" begin="0.5s" dur="0.012500s" fill="freeze" id="d_s_front_upper_mouth_1_0" repeatCount="1" to="M 343.73,539.41 C 309.96,550.64 282,555 282,556 C 282,557 299.92,560.45 312.02,564.61 C 324.11,568.77 345.09,567.21 362.60,564.61 C 380.12,562.01 414.77,559.84 435.08,556.60 C 455.40,553.36 490.18,550.59 520.09,550.59 C 549.99,550.59 576.62,550.59 601,550.59 C 625.38,550.59 651.25,550.59 682.27,550.59 C 713.30,550.59 750.50,555.64 770.05,556.60 C 789.60,557.57 829.05,564.23 842.50,564.61 C 855.95,564.99 876.30,565.28 884.21,562.50 C 892.11,559.73 919.72,556.17 919.72,556 C 919.72,555.37 880.64,549.03 853.76,539.41 C 826.87,529.78 775.73,507.46 742.86,494.74 C 709.99,482.02 703.77,482.02 682.27,474.90 C 660.77,467.77 641.22,467.29 627.43,469.73 C 613.64,472.17 604.30,479.11 601,479.11 C 597.70,479.11 587.67,472.77 576.18,469.73 C 564.70,466.68 542.01,467.29 520.09,474.90 C 498.17,482.51 490.18,485.25 464.16,494.74 C 438.14,504.24 377.50,528.18 343.73,539.41 Z" /> <animate attributeName="d" begin="d_s_front_upper_mouth_1_0.end" dur="0.175000s" fill="freeze" id="d_t_front_upper_mouth_2_0" repeatCount="1" to="M 310.34,547.20 C 302.29,550.22 281,556.75 281,557 C 281,557.25 290.57,558.03 294.17,558.03 C 297.77,558.03 315.22,558.03 329.37,558.03 C 343.51,558.03 405.20,548.51 425.17,546.92 C 445.13,545.32 494.16,541.70 517.79,541.70 C 541.43,541.70 570.93,541.70 603.73,541.70 C 636.53,541.70 669.86,541.70 695.35,541.70 C 720.83,541.70 763.73,545.02 785.27,546.92 C 806.80,548.82 839.81,555.97 862.36,557 C 884.91,558.03 903.32,558.03 905.02,558.03 C 906.72,558.03 918.72,557.17 918.72,557 C 918.72,556.37 871.73,541.46 866,538.75 C 860.27,536.03 782.70,502.90 754.16,491.34 C 725.61,479.77 716.05,474.36 695.35,467.27 C 674.64,460.18 656.34,461.76 643.67,464.27 C 631.00,466.78 602.81,482.22 600.73,482.22 C 598.66,482.22 580.53,467.27 564.11,464.27 C 547.68,461.27 529.01,460.12 509.60,467.27 C 490.18,474.42 473.48,482.52 441.04,494.99 C 408.59,507.46 318.39,544.19 310.34,547.20 Z" /> <animate attributeName="d" begin="d_t_front_upper_mouth_2_0.end" dur="0.100000s" fill="freeze" id="d_r_front_upper_mouth_3_0" repeatCount="1" to="M 408.32,529.10 C 398.25,540.76 386,556.75 386,557 C 386,557.25 408.14,557.56 417.10,557.28 C 426.07,557 452.04,560.14 463.76,554.43 C 475.47,548.72 506.64,526.93 516.31,520.54 C 525.98,514.15 543.77,507.12 554.84,504.36 C 565.91,501.60 585.65,501.60 600.31,501.83 C 614.98,502.06 631.24,502.04 641.62,504.36 C 651.99,506.67 665.70,512.22 678.86,520.54 C 692.01,528.86 724.34,550.20 739.99,554.43 C 755.65,558.65 771.37,557.17 778.88,557.28 C 786.39,557.40 813.72,557.45 813.72,557.28 C 813.72,556.65 802.55,540.78 793.32,529.10 C 784.10,517.41 767.95,501.83 750.59,486.84 C 733.23,471.85 700.23,450.41 678.86,439.52 C 657.48,428.62 637.15,429.62 626.07,433.19 C 614.99,436.76 602.39,443.42 600.31,443.42 C 598.24,443.42 587.03,437.90 572.43,433.19 C 557.84,428.48 534.30,431.48 517.31,440.62 C 500.32,449.76 466.78,475.01 452.46,486.84 C 438.15,498.67 418.38,517.44 408.32,529.10 Z" /> <animate attributeName="d" begin="d_r_front_upper_mouth_3_0.end" dur="0.087500s" fill="freeze" id="d_ow1_front_upper_mouth_4_0" repeatCount="1" to="M 371.59,534.28 C 351.83,549.21 341,556.75 341,557 C 341,557.25 358.68,557.28 364.34,557.28 C 369.99,557.28 405.65,561.32 427.42,554.43 C 449.18,547.53 475.57,539.15 498.19,532.07 C 520.80,524.99 540.27,521.64 553.01,519.36 C 565.75,517.07 586.40,514.27 601.07,514.51 C 615.73,514.74 637.30,516.86 650.70,519.36 C 664.10,521.86 678.86,524.35 703.18,532.07 C 727.51,539.78 757.21,550.20 779.99,554.43 C 802.77,558.65 822.66,557.16 830.17,557.28 C 837.68,557.40 858.72,557.45 858.72,557.28 C 858.72,556.65 853.06,549.21 830.17,534.28 C 807.29,519.36 780.32,503.51 754.76,486.23 C 729.20,468.95 703.44,454.62 678.86,443.52 C 654.27,432.42 635.51,436.78 626.07,440.19 C 616.62,443.59 602.39,452.42 600.31,452.42 C 598.24,452.42 581.16,443.20 569.43,440.19 C 557.70,437.17 537.10,437.17 516.31,444.62 C 495.52,452.06 473.47,464.19 439.68,487.23 C 405.89,510.27 391.35,519.36 371.59,534.28 Z" /> <animate attributeName="d" begin="d_ow1_front_upper_mouth_4_0.end" dur="0.162500s" fill="freeze" id="d_ow2_front_upper_mouth_5_0" repeatCount="1" to="M 439.93,535.65 C 425.27,545.90 411,556.75 411,557 C 411,557.25 425.26,561.29 436.71,562.82 C 448.15,564.34 468.27,571.37 485.21,567.98 C 502.15,564.59 520.42,560.73 534.24,557.73 C 548.06,554.73 556.33,553.36 567.88,552.86 C 579.43,552.35 586.39,554.73 600.35,554.73 C 614.31,554.73 618.32,552.55 631.75,552.86 C 645.18,553.16 651.22,553.54 670.26,557.28 C 689.30,561.02 706.25,566.51 721.69,568 C 737.13,569.49 757.33,564.43 766,562.82 C 774.67,561.21 788.72,556.88 788.72,557.28 C 788.72,557.68 772.86,546.55 762.01,538.36 C 751.16,530.17 740.76,523.18 721.69,510.20 C 702.63,497.21 683.96,483.05 664.62,476.20 C 645.27,469.35 629.00,469.78 619.56,473.19 C 610.11,476.59 602.42,482.41 600.35,482.41 C 598.28,482.41 591.16,476.20 579.43,473.19 C 567.70,470.17 555.23,468.44 534.24,476.20 C 513.26,483.96 491.42,497.13 474.29,510.20 C 457.16,523.26 454.59,525.41 439.93,535.65 Z" /> <animate attributeName="d" begin="d_ow2_front_upper_mouth_5_0.end" dur="0.162500s" fill="freeze" id="d_start_front_upper_mouth_6_0" repeatCount="1" to="M 309,544.07 C 300.82,547.75 281,556.75 281,557 C 281,557.25 284.16,557 285,557 C 285.85,557 334.49,557 350.68,557 C 366.87,557 408.54,555.63 421.82,555.63 C 435.09,555.63 473.42,554.47 497.32,554.47 C 521.22,554.47 575.86,557 600.24,557 C 624.62,557 682.83,553.55 709.74,553.55 C 736.64,553.55 768.05,555.63 779,555.63 C 789.95,555.63 840.67,557 850,557 C 856.89,557 914.03,557 915,557 C 915.97,557 918.72,557.16 918.72,557 C 918.72,556.37 898.73,546.79 893,544.07 C 887.27,541.36 763.02,489.72 742.08,480.68 C 721.15,471.63 704.68,466.11 682.27,458.90 C 659.87,451.68 640.94,450.79 627.43,453.73 C 613.93,456.67 604.30,468.11 601,468.11 C 597.70,468.11 588.71,458.90 573.48,454.33 C 558.26,449.77 530.47,455.96 520.09,458.90 C 509.71,461.83 496.57,466.86 467.52,478.58 C 438.48,490.30 317.18,540.40 309,544.07 Z" />

Notice that front_upper_mouth starts in a starting position (i.e. <path d="...">) and then it goes through 6 movements (i.e. <animate> elements) for a total of 7 positions. You will notice that the “to” of the last <animate> matches the “d” of the starting path. That makes sense because it should return to its starting position at the end of the animation. All the other mouth parts also have 7 positions.

So, I would expect that there would be 7 visemes associated with the word “STRAW”. However, you’ll see that there are only 6 returned by SpeechSynthesizer.VisemeReceived. The visemes returned are: 0, 15, 19, 13, 3, 0. Notice that the first and last are both 0. That is expected since, just like in the animation, the starting and ending position of the mouth should be the same thus the visemes should be the same. It looks like a viseme is missing somewhere in the middle of the word.

I’ve noticed this problem with other words as well. E.g. “TURN” has 7 visemes in the animation but only 6 are sent (0, 19, 5, 13, 19, 0).

Please fix VisemeReceived so that it emits the correct visemes. This inaccuracy takes away a lot from the usefulness of the visemes. Thanks.

EDIT: In case it makes a difference, here are the male/female voices that produced this error:

  • en-US-EricNeural
  • en-US-JaneNeural

EDIT2: Another word that I believe you can clearly see this problem is the word, “YES”.

STRAW_FEMALE_VOICE STRAW_MALE_VOICE

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 21 (4 by maintainers)

Most upvoted comments

I am pushing for the progress, sorry for the delay of high priority tasks.