Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Raspberry Pi Embedded Projects Hotshot
  • Table Of Contents Toc
  • Feedback & Rating feedback
Raspberry Pi Embedded Projects Hotshot

Raspberry Pi Embedded Projects Hotshot

By : Sai Yamanoor, Srihari Yamanoor
close
close
Raspberry Pi Embedded Projects Hotshot

Raspberry Pi Embedded Projects Hotshot

By: Sai Yamanoor, Srihari Yamanoor

Overview of this book

This book is targeted towards beginners and intermediate designers of mechatronic systems and embedded system design. Some familiarity with the Raspberry Pi and Python programming is preferred but not required.
Table of Contents (15 chapters)
close
close
14
Index

Interface of an audio device

In this task, we will work on installing MP3 and WAV file audio player tools on the Raspbian operating system.

Prepare for lift off

The Raspberry Pi is equipped with a 3.5mm audio jack and the speakers can be connected to that output. In order to get started, we install the ALSA utilities package and a command-line mp3 player:

sudo apt-get install alsa-utils
sudo apt-get install mpg321

Engage thrusters

In order to use the alsa-utils or mpg321 players, we have to activate the BCM2835's sound drivers and this can be done using the modprobe command:

sudo modprobe snd_bcm2835

After activating the drivers, it is possible to play the WAV files using the aplay command (aplay is a command-line player available as part of the alsa-utils package) :

aplay testfile.wav

An MP3 file can be played using the mpg321 command (a command-line MP3 player) :

mpg321 testfile.mp3

Note

In the preceding examples, the commands were executed in the directory where the WAV file or the MP3...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech

Create a Note

Modal Close icon
You need to login to use this feature.
notes
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Delete Note

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Edit Note

Modal Close icon
Write a note (max 255 characters)
Cancel
Update Note

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY