Hardware Reference
In-Depth Information
Creating Digital Audio
You can create digital audio i les using numerous tools, from programs on your
computer to your smartphone. Most operating systems have at least one appli-
cation you can use to record your voice. Digital audio can also be “converted”;
converting one format to another is also possible with a large range of applica-
tions, but because some audio formats are licensed, some of these applications
are either shareware or commercial.
A third option is the capability of some more advanced programs to “speak”
directly, using voice synthesis. This can later be used to create new i les con-
taining the voice. This is an interesting solution if you are looking for a robotic
voice system.
For most audio recording, limited resources are required. For nonprofessional
applications, a simple multimedia headset is often more than enough; some USB
models have good sampling rates and offer noise reduction. Try to record your
voice inside with no other ambient noises. Choose a time when you know you
will not receive a phone call or have a visit from someone. Having a break of
even one-half an hour can result in a slightly different voice, so try to record
all the i les you need in a single session.
Storing Digital Audio
Digital audio i les can be extremely large, and wave i les are not compressed.
For a typical desktop computer, this will not be a problem. Audio CDs contain-
ing wave i les could hold 80 minutes of stereo music in 700 megabytes, which
is normally more than sufi cient for most projects. Most audio i les can exceed
the Arduino Due's internal memory and l ash, so another storage medium is
required. To store (and play) digital audio on the Arduino Due, you must use
an SD card with a shield that has SD-card capability.
WARNING The Arduino Due is not a 5-V device; it is a 3.3-V device. Some
shields that are designed for 5-V Arduinos will not work on the Arduino Due, so check
compatibility.
The shield can be any type that supports an SD card; some sensor shields
and most Ethernet shields have an SD-slot present on the board. For more
information on SD cards, see Chapter 12.
Playing Digital Audio
To play back audio i les, you must i rst import the library: Audio.h .
#include <Audio.h>
 
Search WWH ::




Custom Search