Here's how I did it.
1) I created an indigo variable for the name of the Echo device for the announcement and pulled that into the py script:
- Code: Select all
echo_name = indigo.variables[1394334554].value
2) I created an indigo variable for the Alexa voice to be used and pulled that into the py script
- Code: Select all
voice = indigo.variables[313914435].value # Voice to use for announcement
3) I sent the Alex voice to the .js script as a parameter
- Code: Select all
command = u'node ~/Desktop/Alexa/send-alexa-command.js "ssml" "{}" "{}" "{}"'.format(announcement, echo_name, voice)
4) I validate the chosen Alexa voice against the list of voices from this thread and use it for the announcement in the js file
- Code: Select all
var defaultVoice = "Russell";
var defaultLang = "en-US";
var voiceList = [
"Ivy", "Joanna", "Joey","Justin", "Kendra", "Kimberly", "Matthew", "Salli" ,
"Nicole", "Russell" ,"Amy", "Brian", "Emma", "Aditi", "Raveena", "Aditi", "Raveena", "Hans", "Marlene", "Vicki",
"Conchita", "Enrique","Aditi", "Carla", "Giorgio", "Carla", "Giorgio", "Carla", "Giorgio"
];
if (voiceList.includes(process.argv[5] )) {
defaultVoice = process.argv[5];
}