Created
March 27, 2017 07:34
-
-
Save haruiz/4262c380bf3a946c67a843ecd5f73d48 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var exec = require('child_process').exec; | |
var util = require("util"); | |
var talk = (message, lang) =>{ | |
lang = lang === "es" ? (' -l es-ES ') : (' -l en-US '); | |
const cmd = util.format("pico2wave -w speak.wav %s '%s' && sox speak.wav -r 48k speak.mp3 pitch -200 && omxplayer speak.mp3", lang, message) | |
console.log(cmd); | |
exec(cmd, function(error, stdout, stderr) { | |
if(error) | |
console.error(error); | |
}); | |
} | |
module.exports = { talk : talk }//export the talk functions to Robot.js file, This will allow him to speak |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment