Audio Source

From GNU Radio
Jump to: navigation, search


Acts as a microphone input. See Audio Sink for a block that outputs to an audio device such as a speaker.

Not all sampling rates will be supported by your hardware. The audio source can have multiple outputs depending upon your hardware. For example, set the outputs to 2 for stereo audio.

Parameters[edit]

Sample Rate[edit]

To set the Audio sampling rate, click the drop-down menu to see popular rates. Note: not all sampling rates will be supported by your hardware. For typical applications, this should be set to 48kHz.

Device Name[edit]

Leave the device name blank to choose the default audio device.

OSX[edit]

On OSX, Audio Sink will return only zeros unless the GNU Radio binary is launched from an application that has been granted permission to use the microphone. For example, if you are launching GNU Radio Companion from the iTerm command line, go to System Preferences -> Security & Privacy -> Privacy -> Microphone and check the box for "iTerm2".

Once the application has permission, leaving the 'Device Name' blank will connect to the current default audio input device. To see or change the current device, go into the System Preferences, click on "Sound", and then the "Input" tab.

The listings under "Name" contain the exact device names currently available; if a new audio source is attached to the computer then a new name will appear -- for example "Line In" for some Macs. Since most such device names contain spaces, make sure to put quotes around the name argument, for example:

   spectrum_inversion.py -I "MacBook Pro Microphone"

Linux[edit]

On Linux, typical choices include:

  • hw:0,0
  • plughw:0,0
  • default

For Linux ALSA users with audio trouble, follow this procedure:

  • from a terminal window enter:

arecord -L

  • find the entry such as:
   hw:CARD=Device,DEV=0
       USB Audio Device, USB Audio
       Direct hardware device without any conversions

      from the list which matches your device.

  • use the first line of that entry (e.g. "hw:CARD=Device,DEV=0") as the device name (without the quotes).

Windows[edit]

On Windows, go into the Settings, cllck on "System", click on "Sound", and then the "Input" tab. The listings under "Name" contain the exact device names currently available; if a new audio source is attached to the computer then a new name will appear. Since most of the device names contain spaces, make sure to put quotes around the name argument, for example:

   "Microphone (Realtek High Definition Audio)"

OK to Block[edit]

On by default, which should be used when this sink is not throttled by any other block.

Example Flowgraph[edit]

This flowgraph shows the Audio Source block feeding a radioteletype (RTTY) decoder.

RTTY rcv.png