I have one button for start and stop microphone button. Every time i click on the button, it says start and stop mic at the same time wherein i want to click only the start and stop respectively.
Here is my code snippet:
public override void OnGUI()
{
base.OnGUI();
if (GUI.Button(new Rect(10, 60, 50, 50), PlyTexture))
{ //Debug.Log("Button pressed!");
if( m_AcquireSpeechState == AcquireSpeechState.On )
{
//Debug.Log( "acquireSpeech startUtterance mic" );
vhmsg.SendVHMsg("acquireSpeech startUtterance mic");
m_AcquireSpeechState = AcquireSpeechState.On;
}
if( m_AcquireSpeechState == AcquireSpeechState.Off )
{
//Debug.Log("acquireSpeech stopUtterance mic");
vhmsg.SendVHMsg("acquireSpeech stopUtterance mic");
m_AcquireSpeechState = AcquireSpeechState.Off;
}
}
I also tried to put an else if statement but nothing happens.
Thank you in advance.