Alexa Announcements

Posted on
Tue Dec 15, 2020 3:57 pm
ryanbuckner offline
Posts: 1075
Joined: Oct 08, 2011
Location: Northern Virginia

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: 1060
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

Posted on
Tue Oct 24, 2023 7:31 pm
ckeyes888 offline
Posts: 2417
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: Alexa Announcements

Anyone using this in 2022.2 with any success?
Love to get upgraded but would hate to lose this function.

Thanks,

Carl

Who is online

Users browsing this forum: No registered users and 2 guests