Hardware Reference
In-Depth Information
5.
Finally, you can also record a call to file. Note that only the remote part of
the conversation can be recorded, which makes this feature more suitable for
leaving messages and such. Use the following command to record:
linphonec> record message.wav
Bonus one line sampler
Let's wrap up the chapter with a trivial project that's got big pranking potential.
1.
First, make nine short samples, each sample being one second in length using
the following command:
pi@raspberrypi ~ $ sox -t alsa plughw:1 sample.wav trim 0 00:00:01
: newfile : restart
2.
Now, enter this one line sampler command and use your number keys 1 to 9
to trigger the samples and Ctrl + C to quit:
pi@raspberrypi ~ $ while true; do read -n 1 -s; sox ~/
sample00$REPLY.wav -d; done
This is a small piece of bash script where the commands have been separated with
the ; character instead of spreading over multiple lines. It starts off with a while
true infinite loop , which makes the commands that follow repeat over and over
again forever. The next command is read -n 1 -s , which reads one character from
the keyboard and stores it in the REPLY variable. We then trigger the sox command
to play the sample associated with the number by inserting the REPLY value as part
of the filename.
When you get tired of your own voice, replace your samples with small clips of
movie dialog!
Summary
In this chapter, you learned a great deal about audio under Linux in general and
about the ALSA sound system in particular. You know how to configure and test
the audio output of the Raspberry Pi board itself and how to set up your USB audio
gadgets for recording.
You learned how to use SoX to record sound and store it in multiple formats, how
you can avoid typing the same thing over and over with aliases, and how to keep a
recording session running with tmux even when network connectivity is spotty.
 
Search WWH ::




Custom Search