I want to send an offer to the server every time it finishes detecting the offer.
For example, when he discovers, I say "How do I do this." I want to send this offer to the server. However, the following method is called every time it tries to make a sentence. For example, when I say “How can I do this,” it will print “how,” “how to do this,” “how to do this,” is there a place where I can know that the sentence is complete?
private void OnRecognize(SpeechRecognitionEvent result)
{
m_ResultOutput.SendData(new SpeechToTextData(result));
if (result != null && result.results.Length > 0)
{
if (m_Transcript != null)
m_Transcript.text = "";
foreach (var res in result.results)
{
foreach (var alt in res.alternatives)
{
string text = alt.transcript;
if (m_Transcript != null)
{
m_Transcript.text = text;
}
}
}
}
}
source
share