Developing apps for Amazon Echo, called Alexa skills, is different than developing for other devices such as Android or iOS smartphones. Alexa skills are not installed on the actual device. Instead, they are web services hosted in the cloud. When a user wakes an Echo device and makes a request, that request is sent to the Alexa service in the cloud. If the request was intended for your app, the Alexa service sends a request to your app, waits for the response, and delivers the response to the user. You can develop the web service for your Alexa skills using any programming language as long as you respect the Alexa REST interface which uses JSON payloads over HTTPS.
That being said, there are toolkits for various languages and web service frameworks that make it easier to develop your app so you don't have to write the boilerplate code that parses request objects, verifies the authenticity of the requests and serializes the response. Because Amazon is primarily a Linux + Java shop their documentation prioritizes how to develop using that platform. So we wrote this guide for .NET developers and open sourced AlexaSkillsKit.NET to be your toolkit for .NET.
Set up your development environment
The Alexa service is strict regarding app endpoints. It will only call out using HTTPS on port 443 whether it's calling an app during development or deployed to production. This means you need to set up your development machine to accept incoming requests on port 443 which is not typical for a dev environment. Setup is further complicated because, as of this writing, the Alexa HTTPS client that makes the outbound calls to your app does not support SNI. So your app needs to be the HTTPS endpoint bound to the hosts' IP address (which effectively excludes a number of cloud hosting options for your app).
Some commands are fire and forget and have no verbal response - such as 'Alexa, turn TV on.' I guess what I am saying, to get to the point, is that if your web service is on a private network and not accessible outside of your network the Amazon server cannot call your web service.
Irrespective of which web server you use on your dev machine (IIS, IIS Express, etc.) incoming HTTPS traffic on Windows is received by HTTP.SYS, a kernel-mode driver and a core part of the OS, which passes the request to the web server. To configure HTTP.SYS to accept requests on 443, from an elevated command prompt, run
you also need to tell windows firewall to allow incoming traffic on port 443
In addition to receving HTTPS traffic you have to configure your development endpoint with an SSL certificate. Since Alexa service will validate this SSL certificate you either have to get one from an approved CA or generate your own and register the public key in the Amazon Developer Console. The command to generate your own cert is
Whether you purchased a certificate from a CA or generated your own, you need to tell HTTP.SYS which SSL certificate you want to use for your development endpoint so, from an elevated command prompt, run:
- The structure for Plex commands is similar to other Alexa skills. You need to first invoke Alexa either with a watch word like 'Alexa,' then you need to indicate you want to interact with Plex by saying 'ask Plex' or 'tell Plex' before your command. Let's say we want to pull up a specific episode of a TV show.
- Build for voice with the Alexa Skills Kit (ASK), a collection of self-service APIs and tools for making Alexa skills. Skills are like apps for Alexa, enabling customers to engage with your content or services.
- Stop or Pause Alexa: 'Alexa, Shut up' or 'Alexa, Pause.' 3. Change the Volume Want Alexa to crank up the volume? Try saying: 'Alexa, set the volume to 9.' For reducing the volume, simply say 'Alexa, turn down the volume by a notch' or 'Alexa, turn down the volume'.
- The ASK CLI, when run in the terminal where you set the variable, will use that specified profile as the default until you close the terminal session. Thanks for reading this post on using profiles with the Alexa Skills Kit Command Line Interface (ASK CLI.
To get the [certificate hash] you need to find the certificate in the Certificate Manager. Run MMC.exe, go to File | Add/Remove Snap In, then select Certificates. Pick the Computer Account and look under Personal Certificates. Double click on your certificate (you can differentiate by expiration date if you see multiple). Go to Details, and scroll down to Thumbprint. Copy and paste into Notepad so you can remove the inner spaces before pasting it on the command line. If you haven't worked with SSL certificates before this article is a good primer.
If you go the route of generating your own cert Amazon requires that you submit its public key in the Amazon Developer Console where you register your Alexa app, so Alexa service can validate it. Alexa needs the public key in a Base 64 format called PEM in Linux and MacOS but which Windows refers to as Base 64 encoded CER format. To get your cert in this format Run MMC.exe, go to File | Add/Remove Snap In, then select Certificates. Pick the Computer Account and look under Personal Certificates. Right click your certificate and choose Export. In the Export wizard choose 'No, do not export the private key' and then 'Base 64 encoded X.509 (.CER)'.
Take the content of the resulting file and paste it in the Amazon Developer Console under your app's registration, including the BEGIN/END CERTIFICATE markers
When you're done with developing your Alexa app you can undo all this with:
It's outside the scope of this guide, but you have to get HTTPS inbound traffic from the edge of your network to your dev machine. If you're working in a small office or at home this means configuring your broadband modem to send traffic coming in on 443 to your dev machine. If you're in larger office with formal corporate network you have to work with your network admin to set up your dev machine as host in the DMZ and it that's forbidden by policy you have to do development on a rented VM in the cloud.
Start developing
You can use any number of web service frameworks to write your app, like ASP.NET Web API or ServiceStack. Irrespective of framework, the AlexaAppKit.NET toolkit makes it easy to write your app because it
- parses the request into an easy to use object model
- verifies authenticity of the request by validating its signature and timestamp
- performs automatic session and conversation managements so you can easily write conversational apps
Here are the high level steps: Best daw plugins mac.
1. Implement ISpeechletAsync or ISpeechlet in a class that represents your app
(I recommend ISpeechletAsync if your app does makes requests to other cloud services)
2. Route requests from the web server hosting environment to your class
For example, if you're using ASP.NET Web API you write a small wrapper API method:
3. Develop, Test, Debug; Lather, Rinse, Repeat
If you need to see the raw request and response you can attach a debugger because AlexAppKit.NET will output the headers and body to the debugger output. DO NOT use Fiddler as a reverse proxy to inspect traffic from Alexa. Not because Fiddler isn't a good tool for that, but because when Fiddler acts a reverse proxy, it's an open proxy and you'll become a vector for malware. I know this from experience. It took 24h after I opened port 443 to my machine, until I started getting traffic from malware command and control nodes and from what looked like Tor exit nodes.
Released:
gTTS (Google Text-to-Speech), a Python library and CLI tool to interface with Google Translate text-to-speech API
Project description
gTTS (Google Text-to-Speech), a Python library and CLI tool to interface with Google Translate's text-to-speech API.Write spoken mp3
data to a file, a file-like object (bytestring) for further audio manipulation, or stdout
. Or simply pre-generate Google Translate TTS request URLs to feed to an external program.http://gtts.readthedocs.org/
Features
- Customizable speech-specific sentence tokenizer that allows for unlimited lengths of text to be read, all while keeping proper intonation, abbreviations, decimals and more;
- Customizable text pre-processors which can, for example, provide pronunciation corrections;
Installation
Quickstart
Command Line:
Module:
See http://gtts.readthedocs.org/ for documentation and examples.
Project
Licence
The MIT License (MIT) Copyright © 2014-2020 Pierre Nicolas Durette & Contributors
Release historyRelease notifications | RSS feed
2.2.1
2.2.0
2.1.2
2.1.1
2.1.0
2.0.4
2.0.3
2.0.2
2.0.1
2.0.0
1.2.2
1.2.1
1.2.0 Mac sales los angeles.
1.1.8
1.1.7
1.1.6
1.1.5
1.1.4
1.1.3
1.1.2
Alexa Click
1.0.7
1.0.6
1.0.5
1.0.4
1.0.3
Alexa Cli Macbook
1.0.2
1.0
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size gTTS-2.2.1-py3-none-any.whl (24.7 kB) | File type Wheel | Python version py3 | Upload date | Hashes |
Filename, size gTTS-2.2.1.tar.gz (27.6 kB) | File type Source | Python version None | Upload date | Hashes |
Hashes for gTTS-2.2.1-py3-none-any.whl
Algorithm | Hash digest |
---|---|
SHA256 | 900d086f3ac9534f53bf46e815697d8968a2495d1594872bba82c13eeb5ddd06 |
MD5 | 62a44ee1d74e98a9c0dc9982adef11a9 |
BLAKE2-256 | 44314494ecac89677d3c839d079363ab655c4751764803ddcd22bcc37f6d32f8 |
Hashes for gTTS-2.2.1.tar.gz
Algorithm | Hash digest |
---|---|
SHA256 | 93d8f386336c81d3b1d257ed0b4d5ef72660dc38484b0e0df7849b161cbe6324 |
MD5 | c3a7bdf6b95a8efce07a519441a06104 |
BLAKE2-256 | 31276a8726c3c103e6d23fb4d7c1f1e85448a06d5ff85dada0bd5a9f34e81ab9 |