예제 #1
0
 private void Talk_Box_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         string sendmessage = Talk_Box.Text;
         string getmessage  = Robot(sendmessage);
         if (Robot_Box.Text == "")
         {
             Robot_Box.AppendText(getmessage);
         }
         else
         {
             Robot_Box.AppendText("\r\n----------------------------\r\n" + getmessage);
         }
         if (Record_Box.Text == "")
         {
             Record_Box.AppendText(Talk_Box.Text);
         }
         else
         {
             Record_Box.AppendText("\r\n----------------------------\r\n" + Talk_Box.Text);
         }
         Talk_Box.Text = "";
         Voice_Synthesis(getmessage);
     }
 }
예제 #2
0
        private void Voice_BT_Click(object sender, EventArgs e)
        {
            Record_Box.Text = Speech_Recognition(Application.StartupPath + "/speak.wav");
            string sendmessage = Record_Box.Text;
            string getmessage  = Robot(sendmessage);

            if (Robot_Box.Text == "")
            {
                Robot_Box.AppendText(getmessage);
            }
            else
            {
                Robot_Box.AppendText("\r\n----------------------------\r\n" + getmessage);
            }
            if (Record_Box.Text == "")
            {
                Record_Box.AppendText(Talk_Box.Text);
            }
            else
            {
                Record_Box.AppendText("\r\n----------------------------\r\n" + Talk_Box.Text);
            }
            Talk_Box.Text = "";
            Voice_Synthesis(getmessage);
        }