Hardware Reference
In-Depth Information
Let's break down the command:
"C:\Program Files (x86)\PuTTY\plink" : This is the full path to the plink
application. The quotes are necessary because of the space in the Program
Files (x86) directory name. plink is like a command line version of
PuTTY but more suitable for interfacing with other applications such as SoX
in our example.
• We specify that we want to log in as the user pi@[IP address] and to use
the password -pw [password] because the command won't work if it has to
pause and prompt us for that information.
sox -t alsa plughw:1 -t sox - : This starts sox on the Pi itself but sends
the output to our Windows machine through the SSH link.
| "C:\Program Files (x86)\sox-14-4-1\sox" -q -t sox - -d then
pipes that output to our local sox application, which we've given a -q or
quite mode argument for cosmetic reasons, otherwise SoX would show two
competing progress displays.
• The two -t sox arguments instruct SoX to use its own native, uncompressed
file format, which is especially useful for transporting audio between SoX
pipes such as this one.
Let's look at a few additional tricks with PuTTY and SoX:
• It's useful to be able to store the recording on your Windows machine instead
of the SD card on the Pi. The following command will record from the Pi to
myrec.wav on your local desktop:
C:\> "C:\Program Files (x86)\PuTTY\plink" pi@[IP address] -pw
[password] sox -t alsa plughw:1 -t wav - > %UserProfile%\Desktop\
myrec.wav
Note the > character instead of the pipe, which is
used to redirect the output to a file.
• Of course, you should also know how to simply copy files from your Pi using
the pscp command. The following command copies myrec.wav from the pi
user's home directory to your local desktop:
C:\> "C:\Program Files (x86)\PuTTY\pscp" pi@[IP address]:myrec.wav
%UserProfile%\Desktop\myrec.wav
• Just reverse the argument order of the previous command to copy myrec.
wav from your local desktop to the pi user's home directory:
C:\> "C:\Program Files (x86)\PuTTY\pscp" %UserProfile%\Desktop\
myrec.wav pi@[IP address]:myrec.wav
 
Search WWH ::




Custom Search