bookmate game
Packt Publishing

Raspberry Pi for Secret Agents

    Ingridцитує2 роки тому
    Let's break down exactly what's happening here. The sox command accepts an input file and an output file, in that order, together with a myriad of optional parameters. In this case, -t alsa plughw:1 is the input file and -d is the output file. -t alsa plughw:1 means ALSA card number one and -d means default ALSA card, which is the Raspberry Pi sound core. The status line that is continuously updated while sox is running provides many helpful pieces of information, starting from the left-hand side
    Ingridцитує2 роки тому
    Type in the following command to install SoX and an add-on for dealing with MP3 files:
    pi@raspberrypi ~ $ sudo apt-get install sox libsox-fmt-mp3
    Now type in the following command to start what we call a monitoring loop:
    pi@raspberrypi ~ $ sox -t alsa plughw:1 -d
    Ingridцитує2 роки тому
    We can check if ALSA has detected our new audio device and added it to the list of cards using the following command:
    pi@raspberrypi ~ $ cat /proc/asound/cards
    Ingridцитує2 роки тому
    pi@raspberrypi ~ $ speaker-test -c2 -t wav
    Ingridцитує2 роки тому
    amixer cset numid=3 1: Sets the audio out to the 3.5 mm analog jack.
    amixer cset numid=3 2: Sets the audio out to the HDMI cable
    Ingridцитує2 роки тому
    It's time to make some noise! Let's start up the AlsaMixer to make sure the volume is loud enough for us to hear anything, using the following command:
    pi@raspberrypi ~ $ alsamixer
    Ingridцитує2 роки тому
    Type in the following command to list the contents of the asound directory:
    pi@raspberrypi ~ $ ls -l /proc/asound
    The black/white names are files that you can output with cat. The blue ones are directories and the cyan ones are symbolic links, or symlinks , that just point to other files or directories. You might be puzzled by the total 0 output. Usually it'll tell you the number of files in the directory, but because /proc/asound is a special information-only directory where the file sizes are zero; it appears empty to the ls command
    Ingridцитує2 роки тому
    Type in the following command to view a list of all connected audio devices that ALSA knows about:
    pi@raspberrypi ~ $ cat /proc/asound/cards
    The cat command is commonly used to output the contents of text files, and /proc/asound is a directory (or "folder" in the Windows world) where ALSA provides detailed status information about the sound system
    Ingridцитує2 роки тому
    The Advanced Linux Sound Architecture (ALSA), is the underlying framework responsible for making all the sound stuff work on the Pi. ALSA provides kernel drivers for the Pi itself and for most USB gadgets that produce or record sound. The framework also includes code to help programmers make audio applications and a couple of command-line utilities that will prove very useful to us.
    Ingridцитує2 роки тому
    Before we can use the script, we need to install Git, a version control system used by the Raspberry Pi firmware developers, with the following command:
    pi@raspberrypi ~ $ sudo apt-get install git-core
    Notice how easy it is to download and install new software packages from the Internet using apt-get.
    Now, whenever you want to check for firmware updates, type sudo rpi-update and reboot once the script says it has updated your system successfully
Перетягніть файли сюди, не більш ніж 5 за один раз