zplay(1)

NAME
zplay - modem utility to record and play voice files

SYNOPSIS
zplay [options] inputfile ...
zplay [options] -b beep
zplay [options] -d dialout
zplay [options] -r outputfile
zplay -Xshell shellscript

DESCRIPTION
zplay can be used to record greeting messages and to play back recorded messages. It is also intended for use in shell scripts to implement voice-mailbox-like features within vgetty. This manpage only lists the options, for more information take a look at the sample code (especially the vg_dtmf script) or bug me to write the texinfo documentation.

zplay will return 0 if everything went well, 1 if there was an error, 2 if it thinks that there's nobody on the line (to permit hangup detection in shell scripts).

OPTIONS

-r file
    record voice data in file. Use -r /dev/null if you just want to detect DTMF codes.

-c n
    use compression type n for recording (playback uses the type stored in the voice file), the legal values depend on your modem type. Usually, this is the number of bits per sample. Note that the baud rate used must be at least n*sample_rate*1.25, otherwise you'll get garbled sound. I.e., for ZyXEL ADPCM-4, the baud rate must be at least 4*9600*1.25=48000, so you have to use 57600 baud. Rockwell modems usually use a sampling rate of 7200 Hz, the ZyXEL uses 9600 Hz.

-t  use telco (phone) line for i/o (this is the default)

-s  output to internal speaker

-m  input from external microphone

-T n
    set silence time to n/10 seconds, n=0..255

-V n
    set silence volume to n, n=0..1, a high setting means that loud line noise should still be treated as silence.

-L n
    set maximum recording length to n seconds, n=0..MAXINT

-b string
    beep (AT+VTS=string), i.e. -b '[933,0,12]'. The first two numbers are frequencies in Hz, the third number is the beep duration in 1/10 seconds. The brackets and commas are mandatory.

-d string
    dialout (ATDstring), i.e. -d '3261816'. Dials the given number. Since this string is passed to the modem without modifications, You can also use 'T' or 'P' to select tone or pulse dial and other dial modifiers.

-v  verbose output

-x n
    set debugging level to n, n=0..7

-l string
    set device string to string, i.e. -l ttyS1:ttyS2. zplay will try to open one of these devices for voice operations, the default is configured in policy.h.

-S  modem is on stdin (for use in shell scripts). This is used within the vg_* scripts called by vgetty and in scripts called interactively using the zplay -X/bin/sh switch. zplay will not try to initialize the modem or lock the line, but will simply send the modem commands to stdin.

-C  enable DTMF command detection (for use in shell scripts). Read a string of touchtone digits, terminated by #. A * deletes the previous digits. The digits read are output on stdout. zplay will continue reading digits until either a # is read, the timeout period (set by -T) expires, or a hangup is detected.

-D  print DTMF return code on stdout (for use in shell scripts). zplay will quit as soon as a single DTMF tone (0-9,#,*) or a hangup is detected.

-I string
    Ignore the DTMF codes specified in string. For example, you can use -I bd to ignore busy and dialtone return codes.

-K  Flush the modem buffers and discard any DTMF codes up to this point. Useful if you want to disable typeahead for asynchronous DTMF tone handling.

-X shellscript
    connect the modem to stdin, then call a shell to parse the shell script. This way, you can write a shell script containing multiple zplay calls without having problems with timing or line locking. Either use #! /usr/local/bin/zplay -X/bin/sh as the first line of your script or call zplay directly: zplay -X/bin/sh my_shell_script. Remember to add the -S flag to the zplay calls within the script. In interactive scripts, you must read keyboard input from /dev/tty, since stdin is connected to the modem, i.e. read answer </dev/tty

EXAMPLES
zplay -r greeting

Record a voice file, the input is taken from the telco line, i.e. a telephone hooked up parallel to the modem.

zplay -s /usr/spool/voice/incoming/*

Play all the voice messages on the internal modem speaker.

CODE=`zplay -St -C -T 100 messages/type_your_code_now`

Used within the vg_dtmf script, the modem is expected to be on stdout and in voice mode. Play the message via the telco line, record DTMF digits received, quit after 10 seconds of silence or if the user types a '#', and store the digits received in $CODE.

AUTHOR
Original version from Klaus Weidner. Copyright (C) 1995 by Marc Eberhard <Marc.Eberhard@Physik.TU-Muenchen.DE>