{"id":20285475,"url":"https://github.com/mramshaw/alexa-stuff","last_synced_at":"2026-05-08T21:31:38.036Z","repository":{"id":92905040,"uuid":"116209983","full_name":"mramshaw/Alexa-Stuff","owner":"mramshaw","description":"A dumping ground for anything Alexa-related","archived":false,"fork":false,"pushed_at":"2021-05-03T19:20:57.000Z","size":1732,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-12-03T03:42:02.184Z","etag":null,"topics":["alexa","aws","aws-lambda","cloudwatch","cloudwatch-logs","festival","hci","ivr","lambda","nlp","serverless","tts","voice","voice-ux","vui"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mramshaw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-04T03:27:39.000Z","updated_at":"2021-05-03T19:21:00.000Z","dependencies_parsed_at":"2023-05-20T17:45:51.052Z","dependency_job_id":null,"html_url":"https://github.com/mramshaw/Alexa-Stuff","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mramshaw/Alexa-Stuff","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mramshaw%2FAlexa-Stuff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mramshaw%2FAlexa-Stuff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mramshaw%2FAlexa-Stuff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mramshaw%2FAlexa-Stuff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mramshaw","download_url":"https://codeload.github.com/mramshaw/Alexa-Stuff/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mramshaw%2FAlexa-Stuff/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32798250,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alexa","aws","aws-lambda","cloudwatch","cloudwatch-logs","festival","hci","ivr","lambda","nlp","serverless","tts","voice","voice-ux","vui"],"created_at":"2024-11-14T14:26:57.629Z","updated_at":"2026-05-08T21:31:38.019Z","avatar_url":"https://github.com/mramshaw.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Alexa-Stuff\n\n![Alexa Icon](/Images/Amazon_Alexa_logo_115x790.svg)\n\nAs a game developer, I've experimented with TTS (Text to Speech) systems such as\n[Festival](http://www.cstr.ed.ac.uk/projects/festival/) to produce game dialogue.\n\nAchieving natural-sounding results is a lot of work. Good voice actors are expensive,\nand for good reason. A lot of work is required. TTS systems are not as much work, but\nthe results are not anywhere near as realistic either (generally placeholder quality\nonly). For instance, while it is possible to get better results, the following link\nis an indication of the average quality of a [Festival TTS Voice](/Voices/gen_fest.wav).\n\nAlexa is impressive. While the regional voices vary in quality, they all sound fairly\nnatural - with little of the robotic quality often found with TTS systems.\n\nHuman–computer interaction (once referred to as __HCI__) is a very old research topic.\nLikewise, interactive voice response or [IVR](http://en.wikipedia.org/wiki/Interactive_voice_response)\nhas been on the technology horizon for quite some time too. With Alexa and other similiar\nproducts the promise of all of this research has finally reached maturity (which doesn't\nmean to say that further improvement is not possible - in fact, I am sure all of these\nproducts will continue to evolve and improve). What has finally been delivered is a\nfully-fledged __VUI__ ([Voice User Interface](http://developer.amazon.com/alexa-skills-kit/vui))\nwith no keys to press or buttons to push; simply talk to it! Or in other words, a nice\nhands-free option - which is great for preventing distracted drivers.\n\nYou can check out my first published Alexa Skill (Word Scramble) here:\n\n    http://www.amazon.com/dp/B078WGVWL2\n\nOr my latest Skill (Peanut Allergy Facts):\n\n    http://www.amazon.com/dp/B07GB4BG4K\n\nAlso in French (Faits sur l'allergie aux arachides):\n\n    http://www.amazon.fr/dp/B07GB4BG4K\n\nAnd now in Spanish (Hechos de la alergia al maní):\n\n    http://www.amazon.es/dp/B07GB4BG4K\n\n## Contents\n\n* [NLP](#nlp)\n* [Hardware](#hardware)\n    * [Router configuration](#router-configuration)\n    * [App versus Web interface](#app-versus-web-interface)\n    * [Wake Word](#wake-word)\n    * [Volume](#volume)\n    * [Languages](#languages)\n        * [French](#french)\n        * [Spanish](#spanish)\n* [So what's it good for?](#so-whats-it-good-for)\n    * [Alarms](#alarms)\n    * [As a reference](#as-a-reference)\n    * [As a sleep aid](#as-a-sleep-aid)\n    * [Wikipedia](#wikipedia)\n* [Bits and bobs of stuff for Alexa development](#bits-and-bobs-of-stuff-for-alexa-development)\n    * [Alexa-hosted Skills](#alexa-hosted-skills)\n    * [Node.js 8](#nodejs-8)\n    * [Trivia](#trivia)\n    * [Glossary](#glossary)\n    * [Types of Skills](#types-of-skills)\n    * [CanFulfillIntentRequest](#canfulfillintentrequest)\n    * [SessionEndedRequest](#sessionendedrequest)\n    * [Alexa Intents](#alexa-intents)\n    * [Alexa Slots](#alexa-slots)\n    * [Memory Usage](#memory-usage)\n    * [Testing](#testing)\n    * [Logging](#logging)\n    * [Account Linking](#account-linking)\n    * [Permissions](#permissions)\n    * [Endpoints](#endpoints)\n    * [Routing](#routing)\n* [Publishing, operations and the competition](#publishing-operations-and-the-competition)\n    * [Certification](#certification)\n    * [Monitoring and Versioning](#monitoring-and-versioning)\n    * [Commercialization](#commercialization)\n    * [Swag](#swag)\n    * [Alexa versus Google’s Assistant](#alexa-versus-googles-assistant)\n* [UX for Voice](#ux-for-voice)\n* [Privacy](#privacy)\n    * [medium.com](#mediumcom)\n    * [bloomberg.com](#bloombergcom)\n    * [wired.com](#wiredcom)\n* [Ethics](#ethics)\n* [Alexa in the media](#alexa-in-the-media)\n* [Icons](#icons)\n* [Python](#python)\n* [To Do](#to-do)\n\n## NLP\n\nIf you're here because you are interested in natural language processing (NLP),\nmay I suggest you check out my [Speech Recognition](http://github.com/mramshaw/Speech-Recognition)\nrepo instead? Here I am mostly focussed on Alexa __devices__ and being an\n__Alexa developer__. It is possible to use an Alexa SDK for NLP but I have\nno knowledge of this, sorry.\n\n## Hardware\n\nSome general notes on actually *using* an Alexa device. If you haven't got a\nWi-Fi router, you will need one - preferably one that does G/N. And if you are planning\non using the web interface, you will need a Wi-Fi card (to talk to the Alexa device).\n\n#### Router configuration\n\n![Router-setup](/Images/Router_setup.png)\n\nSet your router to use WPA or WPA2 (the _personal_ edition; I don't believe Alexa supports\nthe _professional_ edition as yet. And WPA2 is probably the better option here) but most\ndefinitely __not__ WPA/WPA2. If you are really having problems or just want to get started\nquickly (please re-configure later) use __None__.\n\nSet the cipher type to __AES__ unless you are using __None__ (but probably even then too).\n\nAmazon could really have done a much better job on this; by default I think most routers\nare set to negotiate WPA/WPA2 and TKIP/AES - and Alexa devices will __not__ work if your\nrouter is set this way.\n\n#### App versus Web interface\n\nI was pleased to find that - while an app is probably the way to go - it is entirely\npossible to set up and configure your Alexa device via the web interface (you will need\nan Amazon account, also a Wi-Fi card) available at:\n\n    http://echo.amazon.com\n\n[This link will redirect.]\n\nAs long as you have Wi-Fi enabled, the Alexa device will do a good job of connecting.\n\nYou will need to configure the Alexa device to use a ___permanent___ Wi-Fi connection;\nonce you have set it up (and registered it to your account) it will download some new\nsoftware that will allow it to use Bluetooth or pair to a device.\n\n#### Wake Word\n\nIn the phrase:\n\n    \"Alexa, tell me something\"\n\nThe word `Alexa` is what is called a __wake word__, in other words the trigger for your\ndevice.\n\nTo change it to something else, either open up the Alexa app on your device and change it\nthere or else head to [echo.amazon.com](http://echo.amazon.com), sign in (you will need an\nAmazon account), and use the __Settings__ panel to change it.\n\nThe choices are currently __Alexa__, __Amazon__, __Echo__ and __Computer__.\n\n#### Volume\n\nAlexa devices have `+` and `-` buttons to adjust the volume.\n\nOf course, this can just as easily be done via voice:\n\n    \"Alexa, volume 6\"\n\nAnd:\n\n    \"Alexa, what volume are you set at?\"\n\nAlso, there are `louder` and `quieter` commands too.\n\n#### Languages\n\nAlexa devices have always supported English but now (since March 2018) support other languages:\n\n    http://developer.amazon.com/docs/custom-skills/develop-skills-in-multiple-languages.html\n\nHowever, developing for languages other than English still seems a little problematic.\n\nLanguage configuration is at the Alexa device level, so it is possible to have different Alexa\ndevices converse in different languages - for instance English AND French (but it will perhaps\nbe a good idea to have them respond to different [wake words](#wake-word) so as to save any\nconfusion).\n\n##### French\n\nFor example, the\n[French](http://developer.amazon.com/blogs/alexa/post/eaad8183-585e-4e6c-897d-8710d94b121f/how-to-update-your-skills-for-france)\ndeployment instructions. On the other hand, from the standpoint of quality, Alexa's French\nvoice is far better than any of Alexa's English voices.\n\nWhen you submit your skill for certification, the French copy will be carefully vetted for\ntypos and grammatical errors. Any errors will result in a certification failure.\n\nCheck out the French version of my Peanut Allergy Facts skill (Faits sur l'allergie aux arachides):\n\n    http://www.amazon.fr/dp/B07GB4BG4K\n\nInterestingly, for addressing Alexa devices Amazon prefer the familiar ___tu___ form over the\nmore formal ___vous___ form. Using ___vous___ forms in either the launch phrases or the skill\ncopy will result in the skill being rejected.\n\nThere can be some trivial certification failures, which seem to be Amazon protecting its\nbrand. For instance, they prefer the word \"skill\" to \"compétence\" (which is probably more\ncorrect).\n\nUPDATE: As of October 10, 2018 Amazon announced support for\n[French-Canadian French](https://developer.amazon.com/blogs/alexa/post/9fbab4e0-a4ad-4116-8810-84590e04f762/alexa-skills-kit-expands-to-include-canadian-french)\n(`fr-CA` as opposed to `fr-FR`). The\n[developer instructions](https://developer.amazon.com/blogs/alexa/post/a35a1a38-07fd-4d38-a99c-8d7a3f0be34b/how-to-update-your-alexa-skills-for-french-speakers-in-canada)\nindicate that this may involve using a new `i18n` module.\n\nFURTHER UPDATE: As of March 21, 2019 Amazon have released a new voice model for French-Canadian French.\nIt seems that there are some substantial differences that required training a unique voice model, as reported\nby the [CBC](http://www.cbc.ca/news/canada/montreal/alexa-learns-quebec-french-1.5078881). In the email\nI received from Amazon on March 22nd, they refer to \"Canadian-French\" - but the required language setting\nremains `French (Canada)`. In my opinion the French-Canadian voice and model far exceed any of the English\nequivalents (and so are on par with the original French voice and model) but your mileage may vary.\n\n##### Spanish\n\nAlexa has voices for Spanish, both for es-ES (Spain) and es-MX (Mexico).\n\nAs with [French](#french), Amazon prefer the familiar ___tú___ form over the more formal ___usted___ form.\nUse of the formal forms in either the launch phrases or the skill copy will result in the skill being rejected.\n\nTo my ear, neither of these Spanish voices is of the same quality as the French voices, but that may be\na personal thing.\n\nCheck out the Spanish version of my Peanut Allergy Facts skill (Hechos de la alergia al maní):\n\n    http://www.amazon.es/dp/B07GB4BG4K\n\n## So what's it good for?\n\nIt's a little too early for me to say, but if you're single (Honey, I had a dream you were\ntalking to some woman named Alexa ?!?!) it probably makes a good bedside radio/alarm clock.\n\nUPDATE: As of September, 2018 there is talk of a `whisper` recognition mode (as far as I\nknow, SSML has always supported a whisper mode for Alexa utterances).\n\n    http://developer.amazon.com/blogs/alexa/post/c0e7798d-32bc-4549-9c24-97d204a7bf3a/whisper-to-alexa-and-she-ll-whisper-back\n\n\u003e (The U.S. English version will be available in October.)\n\nMost of the following can also be done from a mobile phone, which is only slightly more\ninconvenient than speaking to an Alexa device. Using an Alexa device is almost always a\nhands-free operation - which is generally a little more convenient. On the other hand,\nAlexa will ___only___ respond to a [wake word](#wake-word) whereas a mobile phone can be\nvery susceptible to room noise and chatter (but does not need a wake word).\n\n#### Alarms\n\nFor instance:\n\n    \"Alexa, set an alarm for 5 minutes\"\n\n    \"Five minutes, starting now\"\n\n    [Five minutes passes.]\n\n    [Alexa devices chimes.]\n\n    \"Alexa, cancel the alarm.\" [Or you could press the wake button.]\n\nTimers and alarms can be named, and you can have up to 100 of them.\n\nApparently they do not depend on the cloud either, being device-resident.\n\nTo hear what alarms are set:\n\n    \"Alexa, what alarms have been set?\"\n\n[\"No alarm has been set.\"]\n\n#### As a reference\n\nFor those hard-to-spell words:\n\n    \"Alexa, how do you spell Wikipedia?\"\n\n[She also knows weights and measures too.]\n\n#### As a sleep aid\n\nIf you are having trouble sleeping:\n\n    \"Alexa, open Rain Sounds\"\n\n[There are far too many of these to be specific, but you can probably find one you like.]\n\nIf you pair Alexa to your smartphone, she can dial numbers for you (but your\nsmartphone could probably already do this).\n\n#### Wikipedia\n\nPerhaps my favourite skill:\n\n    \"Alexa, Wikipedia: Hanoi\"\n\n[She gives the first paragraph or so; you can ask for more if you wish.]\n\n## Bits and bobs of stuff for Alexa development\n\nNow follows some random stuff loosely oriented around being an Alexa developer.\n\n#### Alexa-hosted Skills\n\nAmazon now offers a beta version of\n[Alexa-hosted Skills](http://developer.amazon.com/docs/hosted-skills/build-a-skill-end-to-end-using-an-alexa-hosted-skill.html)\nwhich can greatly simplify the development and deployment process. It doesn't even\nrequire an AWS account! [But it is limited to the [free tier](http://aws.amazon.com/free/)\noptions and limitations.]\n\nCaveats: only __Node.js version 8__ is supported at present; and session data has\nchanged (if I read things aright) from DynamoDB persistence to S3 persistence.\n\nIn my opinion Amazon has greatly simplified the initial coding experience, making\nAlexa Skills a great deal more accessible to beginners. What is not clear to me is\nhow easy it might be to migrate test code into a production environment.\n\nFor my purposes I will be sticking with my established methods - and will not be\nwriting Alexa-hosted Skills.\n\n[UPDATE: there is a \"Promote to live\" button for Alexa-hosted Skills which I missed.\n It may very well be that Amazon handles the test -\u003e production migration, although\n I still need to check this out.]\n\nThe Amazon (and Alexa) developer experience continues to evolve by leaps and bounds.\nWhile I have not always been a fan of some of their \"improvements\" I have to say\nthat I am a fan of ___Lambda Layers___ (released November 2018), which you can read\nabout here:\n\n    http://aws.amazon.com/about-aws/whats-new/2018/11/aws-lambda-now-supports-custom-runtimes-and-layers/\n\nYou can find the developer documentation here:\n\n    http://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html\n\nI am currently considering updating all of my Node.js functions from Node.js 6\nto Node.js 8, so the following feature may well save me some work:\n\n\u003e Lambda Layers are a new type of artifact that can contain arbitrary code and data,\n\u003e and may be referenced by zero, one, or more functions at the same time. Lambda\n\u003e functions in a serverless application typically share common dependencies such as\n\u003e SDKs, frameworks, and now runtimes. With layers, you can centrally manage common\n\u003e components across multiple functions enabling better code reuse. To use layers,\n\u003e you simply put your common code in a zip file, and upload it to Lambda as a layer.\n\u003e You then configure your functions to reference it.\n\nAs this will enable me to provision and/or update a single Node.js runtime, I\nreally think this is a very welcome improvement over the current situation (of\nhaving separate runtimes for each Lambda function).\n\nAs it will __also__ enable AWS console editing of the source code of my Lambda\nfunctions, I think this is a big win.\n\nConsidering the hazy documentation about Alexa-hosted Skills (which are still\na beta offering) I think separate back-end Lambda functions (along with perhaps\na common Lambda Layer) will continue to be my preferred arctitecture.\n\n#### Node.js 8\n\nAlthough there are many language options in terms of writing Lambda functions, in\nmy opinion __Node.js__ is possibly the best choice at present - both for example\ncode and support from the AWS Lambda functions dashboard.\n\nAmazon announced Node.js version 8 on April 2nd, 2018:\n\n   http://aws.amazon.com/blogs/compute/node-js-8-10-runtime-now-available-in-aws-lambda/\n\nOne problem with coding in the Cloud is the necessity to upgrade software according\nto a Cloud Provider's timetable. For instance, I received an email from Amazon on\nMarch 24th 2019 warning me that __Node.js version 6__ would be declared End-of-Life\n(EOL) on April 2019 (this can be as simple as selecting a different Node.js runtime).\n[I also received a follow-up email on April 16th. Kudos to Amazon.]\n\nAs Node.js has the largest attack surface and greatest number of exploits of any\nmodern language, this is actually good news. The roll-out is not too bad either:\nslightly more than 30 days (actually 30 days plus a week) warning of the stopping\nof Node.js 6 activation (April 30) and then 30 days more before Node.js is fully\nshelved (May 30).\n\n[The above only applies to AWS Lambda functions.]\n\nAmazon provides some background on why upgrading to Node.js version 8 is a good idea:\n\n    http://aws.amazon.com/blogs/compute/node-js-8-10-runtime-now-available-in-aws-lambda/\n\n[Well worth a read. __TL;DR__ Node.js 8 features ___async/await___ which really simplifies promises.]\n\n#### Trivia\n\nThere are Easter Eggs in Alexa:\n\n    \"Alexa, cheer me up.\"\n\n    \"Alexa, tell me a story.\"\n\n    \"Alexa, what's on your mind?\"\n\n    \"Alexa, tell me something.\"\n\nFor instance, according to Alexa:\n\n    The word 'boredom' was first coined by Charles Dickens in his 1852 novel Bleak House.\n\nSo in a way, boredom was __invented__ by Charles Dickens. This may not come as a surprise\nto anyone who has ever been required to read one of his very lengthy works!\n\n[This is not a knock on Dickens: I have actually read Bleak House - and I wasn't required\nto do so, so I guess I was reading for pleasure. My point is that actually requiring anyone\nto read ___anything___ is probably a good way to make sure they don't enjoy the experience.\nA better route to go is to ___ban___ the book; our library had a week of banned books\nonce - and I was very surprised to find that I had aleady read at least half of them.\n`Of Mice and Men`, `The Adventures of Tom Sawyer`, `Adventures of Huckleberry Finn` or\n`The Catcher in the Rye`, anyone? Recently I very much enjoyed `The Curious Incident of\nthe Dog in the Night-Time` (recommended by a librarian). All, at one time or another,\nbanned. It seems that pretty much everything that is worth reading has been banned at\none time or another.]\n\n#### Glossary\n\nAs is usually the case, probably the best place to start is by defining terms or establishing\na vocabulary (sometimes called a Domain-Specific Language or __DSL__). For instance, rather\nthan the over-used __app__, Alexa developers write __skills__ (but some of the AWS documentation\nstills discusses skills as if they were apps). The Alexa glossary is actually pretty good\n(also brief) and well worth reading:\n\n    http://developer.amazon.com/docs/ask-overviews/alexa-skills-kit-glossary.html\n\n[As is usually the case, things change quickly in the cloud and the documentation does not\nalways keep pace. For instance, as I write this, [Golang](http://github.com/mramshaw/Golang)\nis not listed in this Glossary as an option for AWS Lambda functions - and Amazon recently\nadded support for Go to Lambda functions. ___Caveat emptor___.]\n\nFor a broader view of things (i.e. not just AWS), check out:\n\n    http://www.witlingo.com/voice-first-glossary-of-terms/\n\n#### Types of Skills\n\nThere are various skill types. The main focus here so far has been\n[Custom Skills](http://developer.amazon.com/docs/custom-skills/understanding-custom-skills.html),\nalthough \n[Flash Briefings](http://developer.amazon.com/docs/flashbriefing/understand-the-flash-briefing-skill-api.html)\n(which allow for RSS or JSON feeds) also look pretty interesting. Although getting these to ___pause___ or\n___stop___ seems to be a little tricky.\n\n#### CanFulfillIntentRequest\n\nIn the case where a user does not know the specific __name__ for a skill, this new beta\noffering allows Amazon to select a set of skills that _might_ fulfill the request:\n\n    http://developer.amazon.com/docs/custom-skills/understand-name-free-interaction-for-custom-skills.html\n\nCurrently in beta (as of August 2018), and US-only.\n\n#### SessionEndedRequest\n\nThis indicates an abnormal end of the current session, most probably a user timeout.\n\nFor more information:\n\n    http://developer.amazon.com/docs/custom-skills/handle-requests-sent-by-alexa.html#sessionendedrequest\n\nNota bene:\n\n\u003e Your service cannot send back a response to a `SessionEndedRequest`.\n\nFor even more information:\n\n    http://developer.amazon.com/docs/custom-skills/request-types-reference.html#sessionendedrequest\n\n[Provides details of the various reasons why the session ended.]\n\n#### Alexa Intents\n\nWhile Alexa provides some very useful\n[Standard Built-in Intents](http://developer.amazon.com/docs/custom-skills/standard-built-in-intents.html#available-standard-built-in-intents)\nit may be a good idea to extend them with Standard Utterances as follows:\n\n    AMAZON.RepeatIntent please repeat\n    AMAZON.YesIntent okay\n\nIf the __Audio Player__ option is checked, AMAZON.PauseIntent and AMAZON.ResumeIntent\nmust be specified. Note that these refer to ___streaming___ audio, not normal audio\nsuch as attending or playback - which will both function correctly without the Audio\nPlayer option specified.\n\nFor a good example of how __not__ to implement an audio-playing interface, try:\n\n    \"Alexa, tell me something inspiring\"\n\n[Neither \"Pause\" nor \"Resume\" seem to work correctly.]\n\nUPDATE: As of April, 2018 this skill seems to have been withdrawn.\n\n    \"Sorry, I don't know that one.\"\n\n[This seems to be what she says whenever she doesn't understand your question.]\n\n#### Alexa Slots\n\nIt's a good idea to check up on the\n[defined Alexa slots](https://developer.amazon.com/docs/custom-skills/slot-type-reference.html)\nwhen considering a voice interaction. Using a predefined slot may well save both you and\nyour users some frustration while getting to grips with using Alexa. The defined slots are\nmainly oriented to the Amazon shopping experience, but some of them may well be useful to\nAlexa developers. They add new\n[List Slot Types](http://developer.amazon.com/docs/custom-skills/slot-type-reference.html#list-slot-types)\nfrom time to time (such as `AMAZON.Animal`), so it's worth checking back periodically.\nBe careful not to use any slot types marked as __Public beta__.\n\nWhile Alexa has some very useful built-in slots, it's probably a 'best practice' to define\ncustom slots. For one thing, the built-in slots are extensive and it is probably a good\nidea to restrict these quite a bit. Follow the following link for some useful tips on\n[formatting slot values](http://developer.amazon.com/docs/custom-skills/define-the-interaction-model-in-json-and-text.html#cert-custom-slot-types).\n\n#### Memory Usage\n\nThe smallest possible allocation for a Lambda function is 128 MB. So it is a good idea to\nuse this as a target, rather than trying to minimize memory usage with procedural code.\n\n#### Testing\n\nRigorous manual testing is of course a first step, but what about automated testing?\n\nAmazon provides a good summary of the various testing options:\n[Why testing and automation matter](http://developer.amazon.com/blogs/alexa/post/e2f3d18c-13ca-4796-bc83-e8a196f20e57/building-engaging-alexa-skills-why-testing-and-automation-matter).\n\nOne interesting quote from the above article:\n\n\u003e we may not be aware of any problems until a user writes a one-star review.\n\nThe [Bespoken](http://docs.bespoken.io/en/latest/) testing framework is well worth a look:\n\n    http://docs.bespoken.io/en/latest/getting_started/\n\nAlexa:\n\n    http://docs.bespoken.io/en/latest/tutorials/tutorial_alexa_unit_testing/\n\nSDK:\n\n    http://github.com/bespoken/virtual-device-sdk\n\nExample:\n\n    http://github.com/bespoken/GuessThePrice\n\nAnd:\n\n    http://bespoken.io/blog/automated-testing-for-alexa-skills-2/\n\nFor monitoring your skills in production, logging (see the next section) is essential.\n\nAmazon Cloudwatch alerts can be set to go off if any unexpected circumstances or events arise.\n\n#### Logging\n\nEach invocation (request or reponse) of a Lambda function will generate billing details,\nconsisting of three [CloudWatch](http://docs.aws.amazon.com/lambda/latest/dg/monitoring-functions.html)\nevents (a START event, an END event, and a REPORT event). These may be filtered out\nof the CloudWatch console by typing:\n\n    -START -END -REPORT\n\ninto the `Filter events` text box (sadly these must be typed in __each and every__ time;\na better way to do this is to use CloudWatch Logs Insights and then create a custom\n __Cloudwatch Dashboard__).\n\nAmazon published a useful blog post on November 27, 2018 introducing Cloudwatch Logs Insights:\n\n    http://aws.amazon.com/blogs/aws/new-amazon-cloudwatch-logs-insights-fast-interactive-log-analytics/\n\n[Note that Cloudwatch Logs Insights will incur usage charges based upon the amount of log data.]\n\nAmazon provides useful query examples, both in the Cloudwatch Insights console as well as at:\n\n    http://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax-examples.html\n\nThe following code can be used to filter out billing details:\n\n```\nfields @message |\nfilter @type != \"REPORT\"\n and @type != \"START\"\n and @type != \"END\"\n```\n\nThe following code can be used to only show exceptions:\n\n```\nfields @message |\nfilter @message like /Exception/\n```\n\nIn my experience CloudWatch Logs Insights includes deleted log entries.\n\nDue to the voluminous billing details, the urge to log each and every interesting user\ninteraction is probably to be avoided. Even so, for debugging reasons it is important to\nlog every __significant__ event (user responses, unhandled events, enough life cycle events\nfor context). There is a rich market for logging analysis, which should be a warning to\nbe careful about what gets logged - for privacy reasons, if not just to reduce clutter.\n\nOf course, it is entirely possible to create a simple skill (such as a Facts skill) that\ndoes not require debugging, in which case the performance statistics available from the\n[AWS Lambda console](http://console.aws.amazon.com/lambda/) may be sufficient.\n\n#### Account Linking\n\nThis refers to linking to an external (i.e. non-Amazon) account. It looks like standard OAuth.\n\n#### Permissions\n\nThis refers to linking to an Amazon account. There are two groups: location (self-explanatory)\nand lists. Alexa customers have two default lists: __to-do__ and __shopping__. Access to these\nseems to be standard REST. There are two permissions: __read__ and __write__. Requests are throttled.\nFollow the link for the\n[Permissions API](http://developer.amazon.com/docs/custom-skills/access-the-alexa-shopping-and-to-do-lists.html#list-management-quick-reference).\n\n#### Endpoints\n\nFor the purposes of providing content distribution, the region mappings are as follows:\n\nAlexa Developer Console|Region|AWS internal region|Shows in AWS Console as\n-----------------------|------|-------------------|-----------------------\nDefault|US West (Oregon)|us-west-2|Oregon\nNorth America|US East (N. Virginia)|us-east-1|N. Virginia\nEurope and India|EU (Ireland)|eu-west-1|Ireland\nFar East|Asia-Pacific (Tokyo)|ap-northeast-1|Tokyo\n\n[The `Endpoints` panel on the Alexa Developer Console provides popups that show recommendations.\n You are limited to regions that provide Lambda functions (initially only North Virginia) - here\n I have chosen to make my default region Oregon (i.e. on the West Coast) for content distribution\n purposes but North Virginia might be a better choice. UPDATE: With all of the endpoints specified\n the default endpoint does not seem to ever be invoked - or at least that has been my experience.]\n\nBear in mind that any needed ancillary resources (S3, DynamoDB tables) must also be duplicated\nto all appropriate regions. For databases, the thorny issue of whether or not to replicate the\ndatabases across regions needs to be considered (for DynamoDB this might be as simple as using a\n[DynamoDB Global Table](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GlobalTables.html)).\n\nInterestingly enough, IAM permissions are the exception as they are __Global__ (i.e. apply to\nall regions). Following security best practices such as the\n[Principle of least privilege](http://en.wikipedia.org/wiki/Principle_of_least_privilege),\nthis means provisioning and allocating separate IAM policies and roles for each region.\n\n[Cloudwatch Dashboards are also Global, so that once defined they are available in all regions.]\n\nWith some jiggery-pokery, the Endpoints panel can be used to test each and every Lambda function\n(endpoint), but the Alexa model must be saved \u0026 rebuilt every time the endpoints are changed.\n\n#### Routing\n\nLanguage variations appear to be routed as follows:\n\nLanguage|variant|Routed to\n--------|-------|---------\nEnglish|en-AU|N. Virginia / Tokyo\nEnglish|en-CA|N. Virginia\nEnglish|en-GB|N. Virginia / Ireland\nEnglish|en-IN|N. Virginia / Ireland\nEnglish|en-US|N. Virginia\nFrench|fr-CA|N. Virginia\nFrench|fr-FR|Ireland\nSpanish|es-MX|N. Virginia\nSpanish|es-SP|Ireland\n\n[Sorted alphabetically]\n\n## Publishing, operations and the competition\n\n#### Certification\n\nOnce your Alexa skill is complete, you can submit it for certification. Amazon posts a\ncertification results ETA on their developer console.\n\nIt's worth checking the certification requirements very carefully before submitting a skill.\nAmazon will cross-reference these if they reject your skill submission:\n\n    http://developer.amazon.com/docs/custom-skills/voice-interface-and-user-experience-testing-for-a-custom-skill.html\n\nThey can - and apparently _will_ - reject a skill for fairly arbitrary reasons, for instance\nif it _might_ compete with their __Audible.com__ business. And they seem to be prone to\nchanging the rules to suit themselves - at the moment, advertising is a no-no, but once\nthey figure out how to commercialize (no pun intended) it I am sure it will again become\nan option.\n\nEven so, their rejection emails are very specific and actually quite helpful - they highlight\nthe rejected sentences and also provide copy that they would prefer. It is worth noting that\nthe name of your skill must be consistent in all usages - even if this might conflict with\nnormal grammatical usage (think of this as \"branding\").\n\nNote that certification testing for compliance is not the same thing as logic testing, which\nis a developer responsibility. It's entirely possible to have a skill certified that still\nhas some bugs in it. There is also a __Skills Beta Testing__ program (with 500 invites) which\nlooks worthwhile.\n\nCertification has gotten lengthier and more stringent over the years (which is a good thing).\nIt took eight calendar days to get my first Alexa skill certified. That skill, resubmitted\nlater with a few minor improvements, only took a day or so to get re-certified. A skill\nsubmitted April 12, 2019 was initially scheduled for an April 30th notification - so 18 days,\nor 12 business days (almost twice as long as a few years ago - but also featured 9 language\nvariations). The initial rejection came April 15 (so about four calendar days) - and took\nissue with some French copy that had previously passed muster (along with some other things).\nAs VUIs (Voice User Interfaces) continue to gain acceptance, it essential that the quality\nof the user experience continues to improve. [After some back and forth, the skill was in\nthe end certified on April 24, 2019 - however, this was a pre-existing skill to which I was\nmainly adding support for [Spanish](#spanish).]\n\n#### Monitoring and Versioning\n\nOnce your skill has been submitted for certification it will be locked on the developer console.\nHowever, if you are using AWS Lambda functions, you can monitor the certification testing via\nCloudwatch Logs.\n\nOnce your skill has been certified (or re-certified), a new development version will automatically\nbe created for you.\n\nWhile it may be tempting to re-use any existing Lambda functions, it is probably a better\nidea to create a new Lambda function for each iteration (version) of your Alexa skill.\n\nThe Alexa developer dashboard is excellent for monitoring purposes.\n\n#### Commercialization\n\n[In-Skill Purchasing](http://developer.amazon.com/alexa-skills-kit/earn) is now generally available.\n\n[Even though I was invited to join the __beta__, I still haven't looked into this so cannot comment.]\n\nAnother development to watch is [Alexa Traffic Analysis](http://www.alexa.com/siteinfo/aws.org).\n\n[I may have mis-read this development. __Alexa.com__ proudly proclaims itself an Amazon company,\n but it may not actually have anything to do with Alexa ___devices___.]\n\nGood demographic data for Alexa is hard to come by, this is all I could find:\n\n    http://www.slideshare.net/stevelsilver/amazon-echo-alexa-demographics-75193964\n\n[Published on Apr 19, 2017]\n\n#### Swag\n\nI got an email March 8th, 2018 that my skill had had more than 100 unique customers within 30 days of publication and therefore\nqualified for the January Echo Dot promotion. My free Alexa Dot showed up ___about a half-hour later___ (now that's shipping!).\n\nStill no custom developer hoodie though. UPDATE: I got an email March 29th that my custom hoodie had been shipped.\nAnd it eventually showed up April 2nd (it was addressed to ALEXA DEVELOPER MARTIN RAMSHAW which I thought was a nice touch).\n\n![Swag](/Images/Swag.png)\n\nAlexa Dot on the left, custom hoodie in the background. If you do not have a Wi-Fi router (right, not free) you will need one.\n\nUPDATE: As of April 2019 it seems that Amazon have largely dropped free developer swag, although they still feature occasional\ncompetitions. Google seem to be playing catch-up however, as they offer t-shirts as well as Google Home devices for qualifying\nnew Actions. [Both companies offer free credits, although once again Google's offering seems to be more generous.]\n\n#### Alexa versus Google’s Assistant\n\n[I have also looked into [Google Assistant](https://github.com/mramshaw/Google-Assistant), although not yet as deeply as Alexa.]\n\nThe first distinction to make when comparing the offerings from Amazon and Google is to differentiate between the ___software___\n(i.e. the capabilities of the devices - such as `Skills` or `Actions`) and the ___hardware___ (meaning the devices themselves,\nsuch as the `Alexa Dot` / `Alexa Echo` / `Alexa Echo Plus` / `Alexa Show` - and the `Google Home Mini` / `Google Home` /\n`Google Home Hub`).\n\nWhile the __devices__ largely offer much the same features (different designer colours, similiar form factors and sound quality),\ndiffering slightly on price and aesthetics, the two offerings are somewhat different in terms of their software capabilities, but\nnot so much that - in this highly-charged competitive market - either offering has a significant advantage. And the situation can\nonly be expected to evolve (and probably rapidly, given that it's a huge market). In short, any comparisons between them must be\ntaken with a grain of salt, given that the situation is very fluid.\n\nEven so, follow the link for an interesting read about\n[Amazon’s Alexa vs. Google’s Assistant](http://gigaom.com/2017/06/12/amazons-alexa-vs-googles-assistant-same-questions-different-answers/).\n\n__tl;dr__ Information is contextual and nuanced, and relying verbatim on either of these\ndevices is problematic. Note that the article is slightly dated, being from ___2017___.\n\nAs of the time of this writing (April 2019) Amazon is apparently leading Google with 15,000+ skills, but as the Google\nAssistant features a completely different integration model and marketplace this is probably not significant. [Google\nactively curates its content, so that it's actions do not need to be actively installed - unlike Alexa skills, which\nneed to be individually ___enabled___.]\n\nThere are extrinsic factors as well; Alexa can tie into the whole Amazon buying experience (as in: \"Alexa, where are my\nshipments?\") - and for entertainment purposes can also tie into Amazon Prime - while Google can integrate with the entire\nGoogle platform (as in: \"What's on my calendar?\" - which ties into Google Calendar).\n\nTo see available Google Actions, check out:\n\n    http://assistant.google.com/explore\n\n[However, be aware that these actions may not be available in all languages or all regions.]\n\nThe devices roughly correspond as follows:\n\nAmazon|Google\n------|------\nAlexa Dot|Google Home Mini\nAlexa Echo|Google Home\nAlexa Echo Plus|no Google equivalent (as far as I know)\nAlexa Show|Google Home Hub\n\nThe smallest devices are fine for voice interaction, but not so great for listening to music (although newer Alexa\nDot devices have an audio-out jack). The mid-range devices feature better speakers (and so are better for listening\nto music), while the high-end devices also have display surfaces.\n\n## UX for Voice\n\nWhile Amazon provides quite a lot of content related to Alexa, sometimes an external\nsource may provide a broader perspective. Some of the following may be of interest:\n\n    http://www.lynda.com/User-Experience-tutorials/UX-Voice-Planning-Implementation/679644-2.html\n\n    http://softwareengineeringdaily.com/2018/05/18/alexa-voice-design-with-paul-cutsinger/\n\nNote that UX for Voice is __not__ [IVR](http://en.wikipedia.org/wiki/Interactive_voice_response),\nwhich is a much older technology.\n\n## Privacy\n\nThere are some troubling privacy aspects to having voice devices in your household or\nplace of work. Here is an interesting video from Vox about some of the implications:\n\n    http://www.youtube.com/watch?v=IUEN2TAqlmU\n\n[The video was posted on Dec 28, 2020.]\n\nNow that adoption of voice-activated devices has become widespread the situation\ncan only be expected to evolve.\n\nOne or two interesting quotes follow.\n\n#### medium.com\n\nFrom a `medium.com` article:\n\n\u003e We expect to enjoy privacy in our own homes, but this is ultimately incompatible\n\u003e with the reality that the data collected by your Echo belongs to Amazon, and not you.\n\nAnd:\n\n\u003e So while virtual assistants themselves are not inherently problematic,\n\u003e they do bring to the fore many of the problems that have built up around\n\u003e our use of centralised data-driven services, and especially so for home\n\u003e Internet of Things devices.\n\nBoth from:\n\n    http://medium.com/oxford-university/whos-storing-your-conversations-e5736fc5d9f5\n\n#### bloomberg.com\n\nFrom a `bloomberg.com` article:\n\n\u003e Amazon.com Inc. employs thousands of people around the world to help improve the\n\u003e Alexa digital assistant powering its line of Echo speakers. The team listens to\n\u003e voice recordings captured in Echo owners’ homes and offices. The recordings are\n\u003e transcribed, annotated and then fed back into the software as part of an effort\n\u003e to eliminate gaps in Alexa’s understanding of human speech and help it better\n\u003e respond to commands.\n\nFrom:\n\n    https://www.bloomberg.com/news/articles/2019-04-10/is-anyone-listening-to-you-on-alexa-a-global-team-reviews-audio\n\nThe article is well worth a read as it gives quite a lot of background on Amazon\nand their voice training practices.\n\n#### wired.com\n\nIt is routine to have human experts review audio snippets to ensure accurate STT transcription.\n\nThis is not without some troubling aspects:\n\n\u003e Google paused human audio review worldwide in July after reports that a contractor was leaking audio snippets in Dutch.\n\nDespite the headline of the article, this is not just a Google issue.\n\nApple:\n\n\u003e About three weeks after Google paused audio snippet review, Apple did as well on August 2.\n\nAmazon:\n\n\u003e Amazon ... offers the option for users to opt-out of sharing audio clips for transcription.\n\u003e The company launched a dedicated \"Alexa Privacy Hub\" in May and added the voice command,\n\u003e \"Alexa, delete everything I said today,\" soon after.\n\nMicrosoft:\n\n\u003e Microsoft said at the end of August that it no longer uses human review for audio snippets\n\nFacebook:\n\n\u003e Facebook said that it would stop human review on audio from Messenger\n\nAnd:\n\n\u003e All the major smart assistant developers maintain that audio snippets are fully anonymized\n\u003e before they go out to reviewers and most specifically say that less than one percent of total\n\u003e interactions with smart assistants actually get reviewed by a person.\n\nAll from:\n\n    http://www.wired.com/story/google-assistant-human-transcription-privacy/\n\n[Wired specializes in stories about technology that are not overly technical. Well worth a read.]\n\n## Ethics\n\nFor techies and tech companies, the ability to be able to do something has usually out-weighed ethical considerations.\n\n[This has been a long-term trend, with science and technology generally out-pacing legal and ethical considerations.\n However, legislation can be relied upon to eventually catch up to technology. Rather than having to expensively\n retrofit privacy safeguards into an existing product strategy, it behooves innovators to behave proactively and\n consider legal and ethical concerns from the outset. This can be an effective differentation strategy, and very\n possibly an effective means of securing a competitive advantage. The end result might very possibly be a\n corporate privacy policy. And then of course there is the troubling issue of [affinity groups](http://en.wikipedia.org/wiki/Affinity_group).]\n\nWhile legal considerations concern themselves with the ___law___ (and can be considered to be the minimum requirement),\nethical considerations go above and beyond and are generally concerned with ___morality___. Just because something\nis __legal__ does not necessarily mean it is __moral__. While legal penalties can include fines and prohibitions,\nethical penalties can include loss of consumer confidence, goodwill, market share and revenue.\n\nFor those interested in such things, the contrasting ethical frameworks are [Deontology](http://en.wikipedia.org/wiki/Deontological_ethics)\nand [Utilitarianism](http://en.wikipedia.org/wiki/Utilitarianism). Deontology is the idea that an action is either\nright or wrong, and can be assessed on that basis. For instance, respecting a customer's right to privacy. Utilitarianism\nis what is known as a [consequentialist theory](http://en.wikipedia.org/wiki/Consequentialism) - in that actions can be\nevaluated in terms of their __consequences__ - and can broadly be categorized as ___the end justifies the means___.\nFor instance, the idea that the benefits of aggregating a properly-anonymized collection of user utterances outweighs\nthe costs of a number of violations of customer privacy (these things generally seem to be framed in terms of cost-benefit\nanalysis).\n\nJust as ethics is a growing concern in the machine learning world, so it is also becoming important in the voice world,\nand not simply from a [privacy](#privacy) perspective either. As the following Fortune article should make clear, failing\nto take into account ethical considerations can be expensive - if not in a purely legal sense, then in a brand,\nmarket-share or professional prestige way:\n\n    http://fortune.com/2018/05/11/google-duplex-virtual-assistant-ethical-issues-ai-machine-learning/\n\n\u003e As prominent sociologist Zeynep Tufekci [put it](http://twitter.com/zeynep/status/994233568359575552):\n\u003e “Google Assistant making calls pretending to be human not only without disclosing that it’s a bot, but\n\u003e adding ‘ummm’ and ‘aaah’ to deceive the human on the other end with the room cheering it… horrifying.\n\u003e Silicon Valley is ethically lost, rudderless and has not learned a thing.”\n\n[The above quote is from the preceding Fortune article.]\n\n## Alexa in the media\n\nYou know Alexa is mainstream when Saturday Night Live parodies it:\n\n    http://www.youtube.com/watch?v=YvT_gqs5ETk\n\nHere is a UK advertisement:\n\n    http://www.youtube.com/watch?v=sulDcHJzcB4\n\n## Icons\n\nSome [Gimp](http://www.gimp.org/) templates\n\n## Python\n\nSome sample Python code\n\n## To Do\n\n- [x] Investigate Alexa Demographics\n- [ ] Investigate the use of [Flash Briefings](http://developer.amazon.com/docs/flashbriefing/understand-the-flash-briefing-skill-api.html)\n- [x] Investigate the use of [DynamoDB](http://aws.amazon.com/dynamodb/) as a back end\n- [x] Investigate the use of [Alexa Custom Slots](http://developer.amazon.com/docs/custom-skills/slot-type-reference.html)\n- [x] Investigate the use of __Account Linking__ and __Permissions__\n- [x] Investigate __Cloudwatch Event Logging__\n- [x] Investigate __Cloudwatch Event Logging filters__\n- [x] Investigate __CloudWatch Logs Insights__\n- [x] Investigate __Cloudwatch Dashboards__\n- [ ] Investigate __Cloudwatch Alerts__\n- [ ] Investigate __CanFulfillIntentRequest__ once it comes out of Beta or becomes multi-language\n- [ ] Investigate [Alexa Automated Testing](http://github.com/alexa/skill-sample-nodejs-test-automation)\n- [ ] Investigate [Alexa Load Testing](http://github.com/alexa/skill-sample-node-js-build-scale-test)\n- [ ] Investigate [Alexa More Intent](http://developer.amazon.com/docs/custom-skills/standard-built-in-intents.html#amazonmoreintent)\n- [ ] Investigate [Alexa Testing](http://github.com/BrianMacIntosh/alexa-skill-test-framework) [looks pretty spiffy]\n- [ ] Investigate [Alexa Timeouts](http://github.com/nickclaw/alexa-ability-timeout)\n- [ ] Investigate [Virtual Alexa](http://github.com/bespoken/virtual-alexa) [also looks pretty spiffy]\n- [x] Investigate [Alexa-hosted Skills](http://developer.amazon.com/docs/hosted-skills/build-a-skill-end-to-end-using-an-alexa-hosted-skill.html)\n- [x] Investigate __SessionEndedRequest__\n- [x] Investigate Internationalization (i18n) and Localization (L10n)\n- [x] Investigate Alexa’s French voices\n- [x] Investigate Alexa’s Spanish voices\n- [x] Investigate Google’s Assistant\n- [x] Investigate Google Actions\n- [x] Add notes on Ethical Principles\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmramshaw%2Falexa-stuff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmramshaw%2Falexa-stuff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmramshaw%2Falexa-stuff/lists"}