0

I am creating an app with Text-to-Speech functionality. The TTS function works 100% fine, but when I add audio wave animation using lottie the tts function and animation does not process well.

When a user clicks the button, the text inside my editor will be converted to speech and give a speech output, when tts process starts, animation of the audio wave also starts, and when the application ends, the animation should end as well.

this is my TTS and lottie code:


                    Indicator.Text = "Start";
                    if (Indicator.Text == "Start")
                    {
                        animationView.Loop = true;
                        animationView.AutoPlay = true;
                        animationView.PlayFrameSegment(0, 60);
                        animationView.Play();
                        var Text = TTSEditor.Text;
                        await CrossTextToSpeech.Current.Speak(Text, speakRate: (float)0.9, pitch: (float)1.1f);
                        Indicator.Text = "End";
                    }

                    if (Indicator.Text == "End")
                    {
                        //animationView.PlayFrameSegment(0, 0);
                        animationView.AbortAnimation(animationView.ToString());
                        animationView.Loop = false;
                        animationView.AutoPlay = false;
                    }

The issue here is when my button is clicked the animation plays 1-3 times and then TTS function will follow.

paraJdox1
  • 805
  • 9
  • 23
  • Can you post your code for TTS start? Like how do you start your speech – Blu Feb 11 '20 at 14:13
  • its in the above code, it is a button click event, this line of code starts the tts functionality: await CrossTextToSpeech.Current.Speak(Text, speakRate: (float)0.9, pitch: (float)1.1f); – paraJdox1 Feb 12 '20 at 08:00

0 Answers0