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.