Is it possible to listen only user's input and ignore TextToSpeech?
Thamotharan
21
Reputation points
I have implemented speech recognition in Xamarin with dependency service.
Meanwhile I am using TextToSpeech
. If user spoke anything then TextToSpeech
need to stop. I have trying it but sometime TextToSpeech
string is became a output of speech recognition.
public void speak(string text)
{
Task.Run(async () =>
{
textToSpeechCancellationToken = new CancellationTokenSource();
await TextToSpeech.SpeakAsync(text, textToSpeechCancellationToken.Token);
});
}
I am textToSpeechCancellationToken.Cancel()
on EndOfSpeech in SpeechRecognitionListener
. But I got which is input of speak function.
Example
speak("hello");
//I am starting speech recognition but I am getting output for speech recognition is "hello"
Please help me.
Sign in to answer