Amazon reveals how to build an Echo speaker with the Raspberry Pi

pete_c

Guru
The power of Alexa for a fraction of the price

By Nick Statt on March 25, 2016 06:47 pm Email @nickstatt
 
Amazon wants to push its Alexa voice assistant as far and wide as possible, so much so that one of the company's employees has released a step-by-step guide to building an Alexa-powered speaker yourself with a Raspberry Pi. The do-it-yourself Echo can be made with a $40 Raspberry Pi Model 2, a USB microphone, and a handful of other cheap components.

The guide was put together and posted to GitHub by Amit Jotwani, Amazon's senior evangelist for Alexa. Jotwani's job involves helping developers — and apparently tinkerers too —  bake the company's voice service into third-party products. It may be a response to a similar Raspberry Pi-powered Echo guide posted by YouTube page Novaspirit Tech earlier this month.

The approach requires some minor coding experience, but it will net you a functioning Alexa speaker for a fraction of the price. The Echo is on sale now for $180, while the newly released and smaller $130 Echo Tap starts shipping on March 31st. The one downside of the DIY speaker: you can't wake it up and talk to it with a key word like "Alexa," as you can with Amazon's products. Instead, you'll need to physically press a button to issue voice commands.
 
hmm, wondering about hooking up to a M1TWA's audio input.
 
the 8 wire connector must have individual hots for each of the paired mic/speaker, and common grounds for the speakers and mics respectively?
 
This is in my queue (mentioned in article above)

https://youtu.be/frH9HaQTFL8


What I am thinking is using an RPi voice recognition like Jasper to be the wake up word, trigger a GPIO pin to a relay to "press" the Mic button, and then the rest of the audio will go through Alexa.

By using a push button you shouldn't be violating Amazon's developer agreement.
You're simply pushing electronically with a third party application.

There's a similar Alexa hack using a text to speech module to feed Alexa

https://youtu.be/9Ilw0f4srE8
 
Just a thought....
 
Has anyone considered modifying  Amit Jotwani's Java client code to enable voice activation instead of hitting the GUI buttons?  Essentially, all the processing is done in the AVSApp.java file.  Specifically, the AVSController class is used as a Echo abstraction for the RPI.  So, it's possbile to use a 3rd party speech engine such as Sphinx4 to activate the various methods of the AVSController class.  For example, a "wake up word" such as PI could be used to trigger the AVSController.startrecording method which records whatever is to be sent out to the cloud.  A separate thread could monitor for "dead air". For example 3 seconds of "dead air" could execute the AVSController.stoprecording method and then send everything to the cloud and wait for a response.
 
This method would eliminate the need for hitting the GUI buttons or implementing any type of hardware momentary switches as found in other solutions.
 
I'm no attorney but it appears to me that using the spoken word  to activate (wake up) the Amazon Voice Services (AVS) is not allowed per the clause below taken from the AVS Program Requirements documentation
(m) you will not implement far-field voice recognition or use of a spoken word to trigger the activation of the Alexa Service in Your Products without Amazon's prior written approval and any such implementation may be subject to additional terms and conditions;
 
My understanding is that using the spoken word  via a 3rd party package such as Sphinx4 etc. to either execute the AVS start/stop recording or to activate a GPIO to do the same is not allowed without prior approval from Amazon.
 
Finally, my opinion and two bucks will get you a cup of coffee.
 
I've been working with Amazon's Java Echo project and have run into a problem configuring the Java Echo Client.  When I copy the URL from the initializing popup window into the browser, I get the following error message.   I've tried both copying/pasting AND manually typing the URL into the web browser.  Neither of which worked. 
 
I've verified that the URL is whitelisted in my Amazon developer security profile.  Has anyone encountered this problem?  If so, is there a resolution?
 
 
 

Attachments

  • amazon.png
    amazon.png
    32.4 KB · Views: 12
BobS0327 said:
I've been working with Amazon's Java Echo project and have run into a problem configuring the Java Echo Client.  When I copy the URL from the initializing popup window into the browser, I get the following error message.   I've tried both copying/pasting AND manually typing the URL into the web browser.  Neither of which worked. 
 
I've verified that the URL is whitelisted in my Amazon developer security profile.  Has anyone encountered this problem?  If so, is there a resolution?
 
As a guess it doesn't like the htttp://localhost:3000/ URL. Amazon can't reach that.
 
Posted the question on the AVS troubleshooting subforum and got a response from an Amazon tech.  He indicated that there must be two entries in the Developer Profile Web Settings tab  under the AllowReturnURLs .  The first being https://localhost:3000 and the second is https://localhost:3000/authresponse.
 
I was following the the instructions found on the AVS developer portal which didn't have the second allowed URL entry.  So, I just entered the first URL but not the second URL which was the source of my problem.  Once the second entry was added, the app worked like a charm.
 
Just a little additional info..
 
The RPI example does require the user to initially log into a  Amazon website to request an authorization token to use the RPI example.  These authorization tokens by default expire after one hour.  But fortunately, the RPI example automatically refreshes the token prior to expiration. 
 
The Echo "magic" process is as follows:
 
The user records a command in WAV  16 Khz mono format.  The binary data from this recording is embedded into a http/2 multipart packet which is fired off to Amazon's Deep Neural Network (DNN)  cloud services for processing.   The DNN then returns a http/2 multipart packet which contains MP3 audio data.  This audio data is extracted from the packet and used to build a MP3 file which can be played by any type of media player such as Audacity.
 
I plan to put together a Proof of Concept (POC) app for this process and post it on my github repo site.
 
Finally, all the api's etc for utilizing Echo can be found on Amazon's developer portal.
 
Back
Top