Talking to people from a distance

Instead of listening in on the action, maybe you'd like to be the one creating all the noise by making the Pi an extension of your own voice. You'll be on a computer with a microphone and the Pi can be somewhere else broadcasting your message to the world through a pair of speakers (or a megaphone). In other words, the roles of the Pi and your computer from the previous topic will be reversed.

Talking on Windows

First make sure SoX is added to Windows as per the instructions in the Listening on Windows section.

  1. Connect your microphone and check the input volume of your device. On Windows 7 you'll find the settings in Control Panel | Hardware and Sound | Manage audio devices under the Recording tab. Make your microphone the default device by selecting it and clicking on Set Default.
  2. Start a command prompt from the Start menu by clicking on the shortcut or by typing cmd in the Run/Search field.
  3. We can start a monitoring loop first to ensure our microphone works as intended:
    C:> "C:Program Files (x86)sox-14-4-1sox" -d -d
    
  4. Now, to send the audio from our microphone to the speakers on the Pi, use the following command:
    C:> "C:Program Files (x86)sox-14-4-1sox" -d -t wav - | "C:Program Files (x86)PuTTYplink" pi@[IP address] -pw [password] sox -q -t wav - -d
    
  5. Maybe you'd like to broadcast some nice music or a pre-recorded message instead of your own live voice? Use the following command to send My Song.mp3 from your local desktop to be played out of the speakers connected to the Pi:
    c:> type "%UserProfile%DesktopMy Song.mp3" | "C:Program Files (x86)PuTTYplink" pi@[IP Address] -pw [password] sox -t mp3 - -d
    
  6. Or why not broadcast an entire album with sweet tunes, located in the My Album folder on the desktop:
    c:> type "%UserProfile%DesktopMy Album*.mp3" | "C:Program Files (x86)PuTTYplink" pi@[IP Address] -pw [password] sox -t mp3 - -d
    

Talking on Mac OS X or Linux

First make sure SoX is added to your operating system as per the instructions in the Listening on Mac OS X or Linux section.

  1. Connect your microphone and check the input volume of your device. On Mac you'll find the settings in System Preferences | Sound under the Input tab. Make your microphone the default device by selecting it in the list. On Linux, use the default mixer application of your distribution or alsamixer.
  2. Open up a Terminal (located in /Applications/Utilities on the Mac).
  3. We can start a monitoring loop first to ensure our microphone works as intended with the following command:
    $ sox -d -d
    
  4. Now, to send the audio from our microphone to the speakers on the Pi, use the following command:
    $ sox -d -t sox - | ssh pi@[IP address] sox -q -t sox - -d
    

    Note

    Attention Mac users

    You'll likely be flooded with warnings from the CoreAudio driver while SSH is waiting for you to input your password for the pi user. Just ignore the messages, type in your password anyway, and press the Enter key—the recording will proceed as normal.

  5. Maybe you'd like to broadcast some nice music or a pre-recorded message instead of your own live voice? Use the following command to send My Song.mp3 from your local desktop to be played out of the speakers connected to the Pi:
    $ cat ~/"Desktop/My Song.mp3" | ssh pi@[IP address] sox -t mp3 - -d
    
  6. Or why not broadcast an entire album with sweet tunes, located in the My Album folder on the desktop:
    $ cat ~/"Desktop/My Album/"*.mp3 | ssh pi@[IP address] sox -t mp3 - -d
    
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.59.48.161