Prosody installation guide: test programs: ansplay

This is a very simple playback application. It answers a call and plays the given speech file. It stops playing when the caller hangs up. If the file ends before the caller hangs up, it starts playing it again from the beginning. The file is assumed to have no headers or other formatting of any kind - just the data. The test program ansrec generates these files directly, but for many formats the header is harmless (sounds like a short burst of noise).

Go to directory $(TiNG)/test.

You must have the call control driver initialised. This is documented separately in the call control documentation.

You must have downloaded firmware modules as listed below.

Run ansplay with the appropriate options (the program is gen-LINUX_V6/ansplay or gen-WINNT_V6/ansplay depending on which operating system you are using).

Command line options are:

-a 1 use AGC (automatic gain control)
-F <format> play data in this format. The known formats can be listed by specifying a question mark (?).
-O play only once. The default is to restart at the beginning of the file when the end is reached
-P <N> The number of channels to allocate per module
-s <speed> play faster or slower (as a percentage)
-t <timeslot> timeslot to use (see Test program timeslots)
-v <volume> play at this volume (adjustment in dB)
-x <serialno> Prosody X card serial number with no Prosody module specification in [...] after it. All Prosody modules on that card are used.
<file> name of file into which data is to be recorded

For example,

	gen-WINNT_V6/ansplay -F ALawPCM@8000 -x 12345678 -P 64 -t 64:0 rec1.dat

would play from rec1.dat data assumed to be A-law encoded speech allocating 64 channels per Prosody Procesor module on the card with serial number 12345678, which must also have the trunks on which the calls will come in.

Note that this program cannot switch data between a Prosody module on one card and a call answered on another card.

The firmware modules that are required depend on the options you specify. Here are the details:

ModuleWhen needed
datafeed always on Prosody X
gainbg If you use '-a 1' for AGC or '-v' to adjust the volume
fast If you use '-s' to play the file faster than normal
slow If you use '-s' to play the file slower than normal
outchan always
sixkout when the file format is ACUBLKPCM@6000, ALawPCM@6000, OKIADPCM@6000, ULawPCM@6000 or otherwise sampled at 6000 Hz
sixkout when the file format is ACUBLKPCM@6000, ALawPCM@6000, OKIADPCM@6000, ULawPCM@6000 or otherwise sampled at 6000 Hz
11_to_8 when the file format is sampled at 11000 Hz
playA when the file format is ALawPCM@6000 or ALawPCM@8000
playima when the file format is IMAADPCM
playmu when the file format is ULawPCM@6000 or ULawPCM@8000
playoki when the file format is OKIADPCM@6000 or OKIADPCM@8000

Just like ansrec, it reports status changes and data speed and it can be stopped with the 'q' command.

The source code for this program is provided (ansplay.c).


This is one of the Prosody test programs .