I have the following code:
public class ChatSystem {
public static void main(String[] args) {
SpeakCommand sp = new SpeakCommand("hello master! How are you feeling today?");
sp.execute();
}
}
import java.io.IOException;
public class SpeakCommand implements CommandInterface{
String message;
public SpeakCommand(String content){
message=content;
}
public void execute() {
try {
System.out.println("spd-say \"" +message+ "\" -p 100 -i 100 -t female1");
Runtime.getRuntime().exec("spd-say \"" +message+ "\" -p 100 -i 100 -t female1");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
Which if executed result in my laptop saying "hello" in the correct voice (that is -p 100 -i 100 -t female1 -r -40
is indeed passed to say). The printout also correctly states spd-say "hello master! How are you feeling today?" -p 100 -i 100 -t female1
which if executed in the command line works. Any idea what I'm doing wrong?
Replace
with
and it will work. Cheers!