I want to send to server the sentence every time it finishes detecting a sentence.
For example, when it detects I speak "How do I do". I want to send this sentence to the server. However, the following method is called every time it tries to form up a sentence. For example, when I speak "How do I do", it will print "how", "how do", "how do I do", is there a place I can know a sentence is finished?
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)
{
// print(text);
//m_Transcript.text += string.Format("{0} ({1}, {2:0.00})\n",
// text, res.final ? "Final" : "Interim", alt.confidence);
m_Transcript.text = text;
}
}
}
}
}