Audio Source: Difference between revisions

From GNU Radio
Jump to navigation Jump to search
(add audio info for OSX)
(Tweak formatting and fixup OSX section)
Line 1: Line 1:
[[Category:Block Docs]]
[[Category:Block Docs]]
Acts as a microphone input.  See [[Audio Sink]] for a block that outputs to a speaker.
 
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.
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.
Line 7: Line 8:


=== Sample Rate ===
=== Sample Rate ===
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.  
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 ===
=== Device Name ===
Leave the device name blank to choose the default audio device.
Leave the device name blank to choose the default audio device.


On MacOSX, go into the System Preferences, click on Audio, and the select either the Input or Output tab. The listings under "Name" contain the exact device name options to provide; since most such device names contain spaces, make sure to put quotes around the argument, for example:
==== OSX ====
 
On OSX, 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:


     dial_tone.py -I "MacBook Pro Microphone"
     spectrum_inversion.py -I "MacBook Pro Microphone"
 
==== Linux ====


On Linux, typical choices include:
On Linux, typical choices include:
Line 35: Line 42:


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



Revision as of 13:41, 1 May 2020


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

Sample Rate

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

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

OSX

On OSX, 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

On Linux, typical choices include:

  • pulse
  • hw:0,0
  • plughw:0,0
  • /dev/dsp

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).

OK to Block

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

Example Flowgraph

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

RTTY rcv.png