Alexa Gadgets Toolkit (Beta): How It Makes the Twerking Bear Groove to Amazon Music
Today, we are excited to announce a new addition to the Alexa Gadgets Toolkit (Beta) – the MusicData Interface which enables you to build Bluetooth-connected gadgets that respond to Amazon Music playing on an Echo device. Tens of millions of Alexa customers enjoy playing music on their Echo devices, and we’re excited to give you the ability to make that experience even more enjoyable with accompanying gadgets.
So how does it work? When a customer says “Alexa, play popular songs on Amazon Music” and the first song begins, a single value representing the average tempo of the song (expressed in beats per minute) is sent to the gadget in the form of a Tempo directive. Another directive is sent when a song stops or transitions to another song on the Echo device. With these directives, you can choose how you want your gadget to react to the BPM data shared. For example, you can map the data to control the speed of motors, flash colors based on predefined “fast” songs, and more. There are endless possibilities for you to build gadget experiences for Alexa customers to enjoy with music.
The functionality provided through the MusicData Interface will continue to grow, but here are some ways you can use tempo data to get started on your first gadget: build a hula girl that sways its hips, a disco ball that lights the room, or even a bear that twerks when Amazon Music is playing on an Echo device.
Alexa Gadgets Spotlight: MusicData Interface + Twerking Bear, by Gemmy Industries
Gemmy Industries introduced its customers to the world of twerking plush animatronics in 2015. Now, they have extended the fun to Alexa customers with Twerking Bear – an animated plush that brings fun into the home of Echo device owners. Twerking Bear is the first commercial product that uses the MusicData Interface.
The diagram below illustrates how all of this works. First, a customer requests a song from Amazon Music on their Echo device, and the command is processed in the cloud. Then, the Alexa Gadgets tempo directive with the BPM value is sent from the Echo device to Twerking Bear via Bluetooth. Based on the BPM value shared, Twerking Bear moves its body motors to the song played, pauses its motors when the song stops, and adjusts the speed of its motors when a new song begins.
Other Gadget Interfaces Used by Twerking Bear
In addition to music, Twerking Bear responds to speech, timers, alarms, reminders, wake word, and notifications – which are available in the Alexa Gadgets Toolkit. You can check out Alexa Gadgets Toolkit (Beta): How It Makes the Echo Wall Clock Tick for more detail on these Gadget Interfaces.
Let’s take a look at how Twerking Bear responds to the following directives that are sent from an Echo device:
When Alexa starts speaking on an Echo device, Speechmarks Directives (SpeechData Interface) are sent to Twerking Bear with speechmark data. The Speechmarks Directives contain visemes, which are mouth positions that correspond to spoken sounds. Twerking Bear moves its mouth motors to demonstrate visual experiences of Alexa's text-to-speech (TTS) so that when a customer asks "Alexa, what's the weather," he/she can observe Twerking Bear moving its mouth in sync with Alexa's response.
Wake Word Detection
When the wake word “Alexa” is detected on an Echo device, a StateUpdate Directive (StateListener Interface) is sent to Twerking Bear which includes the name and value of the state type. For the wakeword state, the valid values are active and cleared. When active, Twerking Bear tilts its head and moves its body motors for a dance movement that acknowledges the customer’s intent. This directive is also used for Twerking Bear to react to timers, alarms, and reminders on an Echo device.
Get Started with the Alexa Gadgets Toolkit
Available in the US, UK, and Germany, you can create your own gadget using one or more of the available Gadget Interfaces. The possibilities for designing delightful gadgets for customers to enjoy are endless. Visit our resources below to get started:
- Alexa Gadgets technical documentation
- Sample code on GitHub
- Sign up for our email list to get updates
We can’t wait to see what you build!
Source: Alexa Developer Blog