Creating a child-friendly audio player with the Raspberry Pi

Lead Image © yupiramos, 123RF.com

Kid Sounds

A Rasp Pi with a webcam and a few scripts creates a very nice, child-friendly media player.

Small children often listen to music and audio books with a childproof CD player made out of tough plastic. The CDs themselves are much less resilient to breakage. Grabbing a disc a few too many times can scratch and ruin it. Luckily, a nifty child-friendly music player put together using a Raspberry Pi and a webcam makes for hours of problem-free listening pleasure.

Design Thinking

This particular problem presents an opportunity to experiment with Design Thinking, which embodies a method of solving problems through innovation. Essentially, the methodology consists of working through four questions. What is the problem? What would happen if? What produces a wow effect? What works?

With the help of the "users" in the playroom, it was easy to identify the problems: Cassettes turn into tangled bundles of tape, CDs get scratched up and misplaced, and the user interface of MP3 players is too challenging. Therefore, it was necessary to find a new user concept.

During the "What if?" phase, the designer has complete freedom to imagine how an ideal solution would look. In the case at hand, the designer looks at possible systems that don't involve a media device that requires navigating through menus or pressing ill-defined, multimodal buttons. Instead, how simple would it be if a child only needs to say, "Play The Lorax" out loud? Even better, wouldn't it be cool if little children could simply hold an album cover in front of the music player and the recording would immediately start playing – even if something else were already playing?

For feedback, instead of cryptic pieces of text appearing on a screen, fun acoustic messages should provide the user with information about whether an activity has been successful or whether it has gone wrong. So, for instance, something like "YEH!" could play if the software recognizes the album cover, or a burp if the image recognition process fails to work.

What Works?

Playing music with the Raspberry Pi works extremely well. All you need is the mini PC, a speaker, and a power supply. If the audio files are not directly available on an SD card, you will need a network connection. Additionally, you need a simplified remote control and an infrared receiver. (Figure  1 provides an overview of the components required.) The webcam is used to recognize album covers. When starting out, it will only be necessary to recognize QR codes. Table 1 summarizes the necessary parts and their approximate costs; you might already have one or more of these items that you can reuse to build the player.

Figure 1: After putting an initial design in place, the next task is to compile a list of components needed to implement the project.

Table 1

Hardware

Component

Price (US$)

Raspberry Pi

$35

Housing

$10

8GB SD card

$6

Power supply 1.5 A

$6

Remote control with IR receiver

$15

Speakers

$10

Webcam

$15

Total

$97

The IR receiver needs to be LIRC (Linux infrared remote control) compatible; that is, the IR signals can be decoded by the lircd daemon [1]. When building the prototype, a compact IgorPlug USB worked for me as soon as I plugged it into the Rasp Pi  [2], whereas the receiver in Table 1 was priced through Adafruit [3] and works only with its matching remote.

In view of the nature of the "user group," it is a good idea for the remote control to have as few buttons as possible. After testing various remotes, I chose the Seki Slim, which has only six buttons but is nonetheless easy to program. Before choosing a remote, be sure it works with LIRC [4]. Unfortunately, this remote is not available in the US, although the Sony RM-KZ1 is similar [5] and also is easy to program.

Linux supports many webcams directly. For example, you can find the Logitech C170 on eBay for around US$  10. The Microsoft LifeCam HD that I used for my prototype delivers too many pixels and makes the recognition process correspondingly more time consuming. As a result, I used configuration parameters to reduce the resolution of the camera. The smaller the resolution, the faster the Rasp Pi can process the pictures.

The operating system for this project, Raspbian  [6], comes with good instructions and is very easy to install  [7]. You will find the software you need for the player in the Debian repositories, and you can install as necessary via the package manager. With the command

sudo apt-get install <package>

you can install the packages listed in Table 2.

Table 2

Software

Package Name

Function

xmms2

Music player

xmms2-client-medialib-updater

Automatic update of the music library

xmms2-plugin-curl

Plugin for streaming Internet radio

lirc

Infrared tools

zbar-code

QR code tools

id3v2

ID3v2 tag editor [7]

id3

ID3v1 tag editor

qrencode

QR code generator

mpg123

MP3 player, including the MP3 libraries

Buy this article as PDF

Express-Checkout as PDF

Pages: 8

Price $2.95
(incl. VAT)

Buy Raspberry Pi Geek

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content