Skip to content
Go to file


Failed to load latest commit information.
Latest commit message
Commit time


Some curl scripts to allow interfacing with Alexa using text as input.


I'm using this along with OpenCV to do face recognition and then let me know who is at the front door: "Simon says, Joe is at the front door."

Initially, I just used my Alexa bluetooth and espeak (very bad sound), but I wanted it to sound like Alexa. So, I wrote this...


Motivated by Miguel Mota

The way this works:

- The text given to is converted into an wav file and sent to the alexa voice service. - The response is then piped to a 'play' command (espeak) to give the response.


You will need - curl - sox (Ubuntu packages: sox libsox-fmt-mp3) - pico2wav (Ubuntu package: libttspico-utils) - espeak (Not used in current version) NOTE: You could change the to use a different speech module, but I've found pico2wav to be pretty good.

How to use:

  1. Follow the instructions from Miguel here: This sets up the service authentication.
  2. Replace the CLIENT_ID in the file
  3. Run (./
  4. Copy/paste the given URL into a browser and login to your amazon account
  5. Look for the code= in the authresponse in the url of the 'failed' webpage
  6. Replace CLIENT_ID, CLIENT_SECRET, and CODE in the file
  7. Run the (./

If all goes well, you will then have two files: token.dat and refresh.dat

For the next hour, you will be able to run the command. If an hour passes, you'll need to run the, then run NOTE: Be sure to update with your CLIENT_ID and CLIENT_SECRET

I setup the to run every hour in cron, then I don't worry about it again.

Note: The steps 1-7 above should only be needed once. The refresh_token should be able to keep an active token from that point on.


./ "Tell me a joke"


Look at the various log files for errors. Also, I 'tee' out the audio sent and audio response.


Some curl scripts to allow interfacing with Alexa using text as input.



No releases published


No packages published


You can’t perform that action at this time.