Pre Alfa- Making

/##

This Article describe basic setup of Mansi

/

 
Step 1: install Ubantu
Step 2: install JAVA
Step 3: Install Netbeans
Step 4: Crate New Project using NetBeans, let me give name myRobo
Step 5: install FSWEbCAM
Step 6: install tractrect
Step 7: Paste Code 1
/***********CODE 1*****************/
Thread.sleep(5000);
Process p1 = Runtime.getRuntime().exec(“fswebcam -r 320×240 –jpeg 100 -D 1 hello.jpg”);
Thread.sleep(5000);
//fswebcam -r 320×240 –jpeg 100 -D 1 hello.jpg
Process p = Runtime.getRuntime().exec(“tesseract hello.jpg out”);
FileReader fr = new FileReader(“out.txt”);
BufferedReader br = new BufferedReader(fr);
String str = br.readLine();
System.out.println(str);
/*****************CODE************/
This code will take pic from webcam and convert it into the text. Step 8 describe
Step 8: Download Project AB (Alice for JAVA)
Step 9: Download “espeak”
Step 10: Add “Ab.jar” as Lib.
Paste Code 2 Given below
/*************CODE 2 ********************/
String path= System.getProperty(“user.dir”);
Bot b = new Bot(“super”, path);
Chat c = new Chat(b);
String ans= c.multisentenceRespond(“how are you?”);
System.out.println(ans);
/* Write Response to SH file */
FileWriter fw = new FileWriter(“runme.sh”);
fw.write(“espeak ‘”+ans +”‘”);
fw.close();
/* Call procedure to run .sh file */
Process p = Runtime.getRuntime().exec(“sh “+path+”/runme.sh”);
/*************CODE********************/
Step 11: Now Show Image containing question will produce spoken response.

Share Post