Alexa Announcements

Ask questions about integrating other services (internet and otherwise) and applications with Indigo.
ryanbuckner
Posts: 1409
Joined: Sat Oct 08, 2011 12:33 pm
Location: Northern Virginia
Contact:

Re: Alexa Announcements

Post by ryanbuckner »

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];
}
User avatar
mundmc
Posts: 1068
Joined: Fri Sep 14, 2012 4:34 pm

Re: Alexa Announcements

Post by mundmc »

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
ckeyes888
Posts: 2438
Joined: Thu Nov 26, 2009 2:41 pm
Location: Kalispell, MT

Re: Alexa Announcements

Post by ckeyes888 »

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

Thanks,

Carl
Post Reply

Return to “Integrating Services/Applications”