Alexa Announcements

Posted on
Tue Dec 15, 2020 3:57 pm
ryanbuckner offline
Posts: 458
Joined: Oct 08, 2011

Re: Alexa Announcements

I have added the device name and voice type to be Indigo variables for more flexibility and reuse. I assume with a delay, I could use indigo actions to populate these variables and then kick off the AlexaAnnounce.py file, without having to have duplicate versions of the code.

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];
}

Posted on
Thu Feb 25, 2021 5:17 pm
mundmc offline
User avatar
Posts: 814
Joined: Sep 14, 2012

Re: Alexa Announcements

Just saw this Ryan, thank you I will likely transition to this approach soon!

The way I'm doing it right now is a super-kludge

Who is online

Users browsing this forum: No registered users and 1 guest