Is it possible to use espeak
in system("");
function like system("aplay 1.wav")
for example?
I like to use espeak in my C/C++ code inside Ubuntu OS.
Is it possible to use espeak
in system("");
function like system("aplay 1.wav")
for example?
I like to use espeak in my C/C++ code inside Ubuntu OS.
You don’t use espeak
“like aplay
”, you use them together in the same command.
I believe you can use espeak
in this way, but the syntax you use is incorrect.
You didn’t specify how you wanted to use espeak
, but here are a couple options.
Read quoted words: system("espeak --stdout 'words to speak' | aplay")
Read from text document: system("espeak --stdout -t mydocument.txt | aplay")
In the comments of your post you said you wanted to use the command system("espeak answer")
. Assuming answer
is a string variable you can try this:
#include <string>
string answer, command;
command = "espeak --stdout '" + answer + "' | aplay";
system(command.c_str);