Close
0%
0%

Animated Computer interface

Why talk to a speaker when you can interact with, say, a cat?

Similar projects worth following
It seems, these days, that voice-controlled personal assistant systems, like Siri, Alexa, and their cohorts, are more and more present in people’s daily lives. They’re useful, and sometimes funny, but they lack true interaction and, well, warmth. They are, in a way, one-dimensional: sound.

What they need is an interface, or, more precisely, a face. I’m not talking about a computer interface, or indeed a human avatar. They need something more engaging, like a pet. A cartoon pet. And let’s not limit it to a screen. What this project is about is integrating a line-drawing interface, in this case a cat, presented by way of a magic mirror.

The system would be modular and fulling customizable: you’d have the animal you want, and could set its level of interactivity and could add new modules, animations, voices and other upgrades and enhancements. For now it uses either Jasper or the Alexa Voice Service, and runs on a Raspberry Pi; but any computer wo

This project started out as a gift for my girlfriend, see the first iteration here:

https://www.youtube.com/watch?v=yCYVUuWnXlM

The idea is straightforward, add a graphic layer to the voice system. Animated the cat when it speaks. Then add other animations, when you're not talking to it. And controls (through a Bluetooth app, maybe) to make it more or less active. 

Wouldn't it look great in a kid's room, on in the bathroom mirror?

The nice thing about Alexa and Google Assistant, is that they already provide SDK allowing us to build our own interface with a Raspberry Pi, or other SoC computer. There’s also projects like Jasper, which don’t rely on one of the Big Three :)

I started out with Jasper, but switched to Alexa in the early phase, because it provided more ready interactions. Unfortunately, that means relying on outside systems, and that's not always fun.

The animation needs to be redone, for obvious copyright reasons, and also to make it more convincing.

catalk.py

The pygame animation file.

plain - 5.65 kB - 03/28/2018 at 00:03

Download

kitten.png

A sketch of the new kitten.

Portable Network Graphics (PNG) - 8.10 kB - 03/26/2018 at 23:47

Preview

  • 1 × Raspberry Pi 3
  • 1 × HDMI Display I used the HDMI 4 Pi: 7" Display no Touchscreen 1024x600 w/ Mini from Adafruiit
  • 1 × Speaker I used one with a jack, but it could be a usb one
  • 1 × USB Microphone Actually, I used a webcam with microphone. The cam could also be used to activate the interface when a user is looking into the mirror
  • 1 × One-way mirror I used the glass from a photo frame, with a one-way film I got at the hardware store. This was a less expensive solution, since I was planning on making a few prototypes

View all 6 components

  • First iteration: Jasper

    Marc A. Belanger03/28/2018 at 00:03 0 comments

    As a first step, I set up Jasper on a clean Raspbian install, on a Raspberry Pi, with a few modules. The idea was to see that it all worked, before trying to add the visuals.

    Since it was only a proof of concept, I downloaded some animated GIF of a cat and extracted the images and divided it in two parts: the cat moving around, and the cat talking. To animate, I decided to go with Pygame; it's fairly straightforward, and easy to set up, you can see the code in the file, catalk.py.

    Next step was to insert the animation into the system. The way Jasper works is:

    • wait for the wake word (or button press)
    • record speech and transcribe
    • send the transcription to a module which returns a text answer
    • turn the answer into a sound file
    • play the sound file.

    My intervention was between the last two, in this fashion: create and start a thread

    isTalking = threading.Thread(target=os.system, args=('mpg123 -q {}response.mp3'.format(path),))    	isTalking.start()

    Animate the cat while the sound is playing

    while isTalking.isAlive():
        	catalk.talkingcat()

    That's it! All in all, at that point, it wasn't too difficult (for someone not too used to Python).

    Next, we assemble it into a magic mirror.

View project log

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates