This program is furnished on an AS IS basis as a demonstration of audio applications programming.
radio_xmit is the Radio Free Ethernet (RFE) broadcast utility. (For an overview of Radio Free Ethernet, refer to the radio.6 manual page.) Though radio_xmit is normally initiated directly by the window-based xmit.6 program, it may also be used directly as a command-line program, or in conjunction with a user-written window-based tool.
In Normal Mode (the default case), radio_xmit is initiated with a set of broadcast options specified on the command line. The program immediately begins transmitting audio data over the network according to the currently selected options. The program will terminate on receipt of a SIGINT (control-C). If an input file is specified, the program will exit when the entire file has been broadcast.
If -C is specified on the command line, radio_xmit operates in Command Mode. In this mode, the program reads and processes command options from stdin and writes error and status information to stderr. Window-based tools use Command Mode to control the broadcast program and receive status information for display. When operating in Command Mode, radio_xmit requires that a station name and input file be specified explicitly, and the START command must be issued to initiate broadcasting.
The broadcast options are described below. If an option requires a value, the option name must be followed by an equal sign (=) and the value. If an option takes a ON/OFF value, the default is ON if the value is missing or poorly constructed.
When Squelch is disabled, all audio input data is always transmitted. Squelching only occurs for audio device input; audio files are not squelched, even if they contain silence. The Squelch option is enabled by default.
Data format conversions only occur for audio device input; audio files are transmitted in the format in which they were stored. By default, audio data is broadcast uncompressed.
Automatic Gain Control adjustments only occur for audio device input; audio files are broadcasted at the level at which they were recorded. The Agc option is enabled by default.
Autostop is only processed for audio device input; broadcasting always stops when an end-of-file has been reached on audio files. The Autostop option is disabled by default.
Normally, the address should end in 0 or 255, in which case an id-address and data-address are constructed as follows: the id-address consists of the address with the last byte set to 255; the data-address consists of the base address with a randomly-selected last byte (0-254). Station identification packets are broadcast to the id-address, and normal audio data packets are broadcast to the data-address. This convention allows RFE receivers to register interest only in the id-address, so that audio data packets need not be replicated over network gateways until a receiver actually tunes in to the station.
If the IP Multicast address ends in a byte that is in the range 1-254, then the address remains unmodified, and both station and identification packets are broadcast to that address. This convention allows a specific multicast address to be used for multi-party audio conferences.
The default IP Multicast address is designated by the hostname RadioFreeEthernet. The special hostname BROADCAST may be used to force the program to transmit UDP Broadcast packets (which will not be relayed over a network gateway). The radio.6 manual page contains more information on the RFE network implementation.
The default port number is designated by the service name radio. The radio.6 manual page contains more information on configuring the port number.
For use with real-time audio conferencing, shorter delays may be desired. For experimental purposes, the Buffer command is provided to alter the input delay. The buffer size is specified in bytes. For real-time experimentation, a reasonable value is 256 (corresponding to approximately 1/32 of a second). Note that a side-effect of lowering the input buffer size is to lower the transmitted packet size, resulting in an increased number of broadcast packets.
Let's say that you have a radio at work that you always keep tuned to your favorite station (though you might shut off your speakers when you don't want to listen to it). If you connect its output to your workstation audio input, you can broadcast the station over the network by using the following command (the Autostop option will cause the program to sign-off and exit if you turn your radio off for a minute or longer):
example% radio_xmit Station=KPFA Input=/dev/audio Autostop=on
The following shell script may be scheduled to run every day at 6:00 AM to record a half-hour of news and rebroadcast it at a more sensible time:
#!/bin/sh # Record from /dev/audio for 30 minutes (around 14 Mbytes). file=/bigdisk/sound/news audiorecord -t 30:00 $file # # If this runs at 6am, the news is over at 6:30. Wait 3 hours til 9:30. sleep 10800 # # Now broadcast the news on the network and remove the file when finished. radio_xmit Station=KPFA Input=$file rm $file
Created by unroff & hp-tools. © by Hans-Peter Bischof. All Rights Reserved (1997).
Last modified 21/April/97