Reference

zyxeltopvf(1)

utility programs for editing voice files

Part of pvf(1).

NAME

pvf - utility programs for editing voice files

SYNOPSIS

zyxeltopvf [-r610|-r601]

pvftozyxel3 [-r610|-r601], pvftozyxel2 [-r612|-r610|-r601]

pvftobasic, basictopvf

pvftolin [-signed|-16i], lintopvf [-signed|-16i] [skip]

pvftoau [-ulaw|-linear8] [rate], autopvf [-info]

pvftovoc [rate], voctopvf [-info]

pvfamp amplification

pvfcut [head] tail

pvfecho [delay] [volume]

pvfmix filename

pvfreverse

pvfspeed speed [exponent]

pvfsine time frequency

pvffft [-info] [-kill <PID>] <skip> <sample_size> <thresh>

DESCRIPTION

Unless stated otherwise, these programs read a pvf voice file from stdin and write the modified result on stdout. pvf files are simply a stream of signed 16-bit integers (stored MSB first), they can easily be manipulated using cat and similar tools.

USAGE

zyxeltopvf [-r610|-r601]

Convert a ZyXEL ADPCM-2 or ADPCM-3 file to the internal pvf format. Note that there are two different versions of the adpcm format used by ZyXEL, it was changed with the introduction of the 6.10 ROM release. The default is specified in the Makefile to match your modem, the -r6xx flag can be used to override this default.

pvftozyxel2 [-r610|-r601], pvftozyxel3 [-r610|-r601]

Convert pvf format to ADPCM

pvftobasic, basictopvf

Conversion to/from `audio/basic' as defined in RFC 1521 (MIME) as the "absolutely minimal lowest common denominator audio format.", which is 8-bit ISDN uLaw (PCM) at a sampling rate of 8000 Hz.

pvftolin [-signed|-16i], lintopvf [-signed|-16i] [skip]

Conversion to/from linear samples. Default is 8 bit, the -16i flag is used for 16-bit files in intel byte order. Use the -signed flag to treat the samples as signed integers, default is unsigned.

pvftoau [-ulaw|linear8] [rate]

Convert to SUN .au format. Default format is linear (16 bit), use -ulaw for 8-bit uLaw and -linear8 for 8-bit linear output. The rate is written into the file header, but it doesn't do any sampling rate conversion, use pvfspeed for that.

Since pvf samples are 16 bit wide and the ZyXEL sampling rate is 9600 Hz, this is the default setting and it is directly supported by the Sun dbri(4) device. The defaults can be overridden; the only useful arguments for output on the Sun audioamd(4) device are `-ulaw 8000'.

autopvf [-info]

Convert from SUN .au format. The input file must have a valid .au header, supported formats are LINEAR_16, LINEAR_8 and MULAW_8, single channel, unfragmented. Note that the sampling rate is ignored. The -info flag is used to print the file header information to STDERR.

voctopvf [-info], pvftovoc [rate]

Convert to/from `Creative Voice' *.VOC format. Only plain 8-bit unsigned samples are supported. The -info flag is used to print the file header information to STDERR. The optional rate is written into the voc header, the default is 9600 Hz.

pvfamp amplification

Multiply each sample by the floating point number amplification

pvfcut [head] tail

Cut off tail seconds from the end of the voice file (a negative number causes it to add a pause of the specified length). If two numbers are given, the first applies to the start and the second to the end of the data.

pvfecho [delay] [volume]

Add an echo delayed by delay seconds (default 0.15) with a relative volume of volume (default 0.3).

pvfmix file

Mix two pvf files. The data stream on stdin controls the length, file is truncated if it is longer. This is intentional, this way you can add background noises without having to match the lengths first. Note that you probably have to reduce the amplitude of the input files to avoid distortion due to overflow.

pvfreverse

Reverse the direction of the data stream.

pvfspeed speed [exponent]

Change the sampling rate. speed is a floating point number, 1.3 corresponds to a 30% speedup. The optional exponent can be used for special effects (try 0.95 or 1.05).

pvfsine time frequency

Generate a sine wave with a frequency of frequency Hz and a duration of time seconds. Note that the frequency is calculated for a 9600 Hz sampling rate.

pvffft [-info] [-kill <PID>] <skip> <sample_size> <thresh>

Do an fft on the voice data and return 0 for voice and 1 for data. This is intended to be used in the vg_fft.in script.

skip specifies the amount of data to skip before applying the fft, this is to give human callers time to start speaking. 1 second = 9600 samples.

sample_size specifies the size of the sample tested via fft, must be a power of 2. 1 second = 9600 samples.

The threshold is used for differentiating voice and data; data calls seem to have an index of 4 or lower, voice calls of 15 or higher.

If the kill parameter is used, process PID will get a SIGPIPE once pvffft has finished reading, and a SIGUSR2 if the sample is considered to be a data call.

EXAMPLES

adpcmtopvf <A | pvfcut -1 .5 | pvfmix B | pvftoadpcm3 >C

Read the adpcm file A, add one second of silence at the start and cut off the last half second, mix it with the pvf file B, convert the result to ADPCM-3 and store it in the file C.

adpcmtopvf <A | pvfspeed 1.2 | pvftobasic >B

Convert a voice message to a format suitable for inclusion in a MIME message.

AUTHOR

Copyright (C) 1993 by Klaus Weidner

Sun .au conversion based on code by Craig Reese and Joe Campbell

ADPCM conversion based on the documentation by ZyXEL Communications Corporation

fft code by