(Page 1 of 1 in this chapter)


Chapter 9

Demonstration Programs and Utilities


9.1 Introduction
9.2 Demonstration Programs
9.2.1 Voice File Copy/Convert Program: vcecopy
9.2.2 Voice File Information: vceinfo
9.2.3 Voice File Play: vceplay
9.2.4 Voice File Record: vcerec
9.3 Utilities
9.3.1 Make Prompt: mkprompt
9.3.2 Test Prompt: testpmpt
9.3.3 VOX File Information: voxinfo

9.1 Introduction

This chapter presents the demonstration programs and utilities shipped with the CT Access Voice Message service.

CT Access is shipped with source code for all demonstration programs. Each demonstration program is shipped as an executable program and with its source and makefiles.

Before you start the demonstration programs, ensure that:

Refer to the appropriate installation manual for your operating system for details on installation.

9.2 Demonstration Programs

The following demonstration programs are provided with the CT Access Voice Message service:

Program

Description

vcecopy

Copies messages from one voice file to another and copies, deletes, and reads message text from a file.

vceinfo

Displays voice file information and displays message text.

vceplay

Demonstrates using the Voice Message service to play messages in voice files.

vcerec

Records one or more messages to a voice file and displays message text.

CT Access also provides utilities. Refer to Section 9.3.

9.2.1 Voice File Copy/Convert Program: vcecopy

Name

vcecopy

Purpose

Copies messages from one voice file to another. If the files have different encodings, the appropriate conversion is performed.

Usage

vcecopy source file destination file [options]

options can either precede or follow the two file names. Valid options are:

Encoding Options
Option

Description

-e encoding

Specifies the encoding of the source file. This is needed only if the source is a flat (.vce) file. Entering -e? displays the following valid values:

1 NMS-16
2 NMS-24
3 NMS-32
4 NMS-64
10 MULAW
11 ALAW
13 PCM8M16
14 OKI-24
15 OKI-32
16 PCM11M8
17 PCM11M16
20 G726


File Creation Options
Option

Description

-x

Deletes the destination file if it exists. This is the default behavior when the destination is not a VOX file. The default for VOX files is to write to an existing file, if any.

-n indices

Specifies number of indices to allocate in a newly created VOX file. Default is the larger of 250 or 2x the number of messages.

Conversion Options
Option

Description

-g gain

Specifies gain in dB. The default is 0 (no gain). The valid range is -24 to +24.

-s energy

Deletes silence from the beginning and end of a message containing an NMS encoding. energy is a relative threshold. Default = 25

-c encoding

Specifies the encoding of the destination file when it is to be converted from the source.

Note: You can alternately specify a WAVE PCM encoding as
rate M|S bits. For example, 22M16 for a coding of 22000 (nominal) samples/sec, Mono, 16 bits per sample. rate can be 8, 11, 22, or 44.

WAVE files are supported only under Windows NT.


Message Number Options
Option

Description

-m [src msg] [,dest msg]

Specifies source message numbers and destination message numbers. The default is to copy all messages in the source file. If only a source message is specified, the destination message number is the same as the source message number. Source message numbers and destination message numbers are ignored if the respective file type is non-VOX.


Message Text Options
Option

Description

-t N

Do not copy message text.

-t O

Copy only message text.

-t F

Source file is a text file containing lines of the form
<message number>:<text>

File Options
Option

Description

-i input file type (VOX | WAV | VCE)
-o output file type (VOX | WAV | VCE)

By default, the file type is inferred from the file name. Any besides .vox or .wav is considered VCE (flat).

Note: WAVE file functionality is only available in Windows NT.

Description

vcecopy is a universal voice file copy and conversion demonstration program. It includes the following features:

Files are assumed to have an extension of .vox if no extension is specified. Input files can be anywhere in the CTA_DPATH path. The current directory is always searched first.

Examples

vcecopy prompts temp -s25 -x
copies all messages in prompts.vox to temp.vox and trims silence
vcecopy one.wav numbers.vox -c3 -m1 -g-6
vcecopy two.wav numbers.vox -c3 -m2 -g-6
copies messages from 2 Wave files to a single VOX file with NMS32 encoding and reduces the volume by 6dB
vcecopy -x -e10 test.vce message1
copies a message in a flat file named test.vce which has
mu-law encoding to a VOX file named message1.vox. A new file is created.
vcecopy greeting.vox test.vce -e 14 -i VCE
copies a flat file named greeting.vox containing OKI-24 encoding to a flat file named test.vce.
vcecopy input.wav output.wav -c 22m16
copies a wave file named input.wav to a new file named output.wav with 22kHz, 16 bit encoding
vcecopy prompts.txt prompts.vox -t file
copies message descriptions from a text file to a VOX file.

9.2.2 Voice File Information: vceinfo

Name

vceinfo

Purpose

Displays voice file information.

Usage

vceinfo [options] filename

where options are:

:
Option

Description

-e encoding

The encoding of the file. This option is only needed for flat files. Entering -e? displays the following list of valid values:

1 NMS-16
2 NMS-24
3 NMS-32
4 NMS-64
10 MULAW
11 ALAW
13 PCM8M16
14 OKI-24
15 OKI-32
16 PCM11M8
17 PCM11M16
20 G726

-f filetype

File types are .vox, .wav, and .vce. By default, the file type is inferred from the file name. A file having an extension other than .vox or .wav is considered VCE (flat). If no file type is specified and the file name does not have an extension, .vox is assumed.

-n

Do not show message information.

-?

Displays an on-screen list of options.

Featured Functions

vceClose, vceGetHighMessageNumber, vceGetMessageSize, vceGetOpenInfo, vceOpenFile, vceSetCurrentMessage

Description

Displays information about a voice file including the size of the message.

Examples

        c:> vceinfo ctademo.vox
CT Access Voice File Info Utility V 1.5 (Dec 11 1997)

File: `ctademo.vox'
Type: NMS Vox
Encoding: NMS 24 Kbps
High Msg: 18
Msg 0 is 820 ms "zero"
Msg 1 is 700 ms "one"
Msg 2 is 600 ms "two"
Msg 3 is 620 ms "three"
Msg 4 is 600 ms "four"
Msg 5 is 640 ms "five"
Msg 6 is 720 ms "six"
Msg 7 is 660 ms "seven"
Msg 8 is 480 ms "eight"
Msg 9 is 740 ms "nine"
Msg 10 is 1600 ms "the digits called were"
Msg 11 is 1440 ms "the calling party's number is"
Msg 12 is 1240 ms "thank you for calling"
Msg 13 is 3700 ms "press 1 to record, 2 to play, 3 to hang up"
Msg 14 is 1360 ms "there is nothing to play"
Msg 15 is 1940 ms "you are being called by the demo"
Msg 16 is 3800 ms "please enter the extension of the party "
Msg 17 is 2700 ms "I'll try that extension now"
Msg 18 is 1540 ms "goodbye"

9.2.3 Voice File Play: vceplay

Name

vceplay

Purpose

Plays voice files. Demonstrates using the Voice Message service to play messages in voice files. User interface from keyboard or
touch-tones allows control of pause/resume, forward/rewind, louder/softer and faster/slower. Refer to
Section 3.2, Playing for more information.

Usage

vceplay [options] filename [additional filenames ...]

where options are:

:
Option

Description

-b board

Specifies the board number. Default = 0

-e encoding

The encoding of the file. This option is only needed for flat files. -e? displays a list of choices.

-m start [:end]

Specifies the message or messages to play. If only `start' is given, then only that message will be played. If `end' is also specified, then all messages from start to end, inclusive, will be played.

-p protocol

Waits for and connects to an incoming call. -p specifies the call control protocol. Default is LPS0. To use vceplay with a phone directly connected to a DID port on an AG-8 board, specify the NOCC protocol. For example, "vceplay -pnocc {filename}".

-s [stream:]slot

Specifies the port (DSP) address. Default = 0:0.

For AG-24/30/48/60 boards, specify the MVIP stream and slot. For all other boards, you need to specify only the slot.

-?

Displays an on-screen list of program options.

Keyboard and Touch Tone Control

The following single-digit commands can be entered either with a keystroke or a touch tone:

Command

Description

1

Beginning of message/previous message

2

Next message

3

Next file

4

Rewind 2 seconds

5

Pause/resume (toggle)

6

Forward 2 seconds

7

Slower

8

Softer

9

Faster

0

Louder

*

Redisplay commands

# or <esc>

Exit

Note: 1 goes back to the previous message if you are currently at the beginning of a message.

Featured Functions

vceClose, vceGetContextInfo, vceGetHighMessageNumber, vceGetMessageSize, vceOpenFile, vcePlay, vceSetCurrentMessage, vceSetPlayGain, vceSetPlaySpeed, vceSetPosition, vceStop

Description

vceplay plays messages from one or more voice files. Use the keyboard or touch tones to control playing.

Examples

vceplay -m2:4 american.vox
plays messages 2,3, and 4 in american.vox
vceplay c:\test\hello.wav
plays the message in hello.wav
vceplay -e3 test.vce
plays a flat file named test.vce. The encoding of the file is NMS24.
vceplay -e?
displays the encoding values and their names.
vceplay .\*.wav
plays all of the wave files in the current directory.

9.2.4 Voice File Record: vcerec

Name

vcerec

Purpose

Records voice files. Refer to Section 3.3, Recording for more information.

Usage

vcerec [options] filename [additional filenames ...]

where options are:

:
Option

Description

-b board

Specifies the board number. Default = 0

-e encoding

The encoding of the file. This option is only needed for flat files. Entering `-e?' displays the following list of valid values:

1 NMS-16
2 NMS-24
3 NMS-32
4 NMS-64
10 MULAW
11 ALAW
13 PCM8M16
14 OKI-24
15 OKI-32
16 PCM11M8
17 PCM11M16
20 G726

-f filetype

File types are VOX, WAV, and VCE. By default, the file type is inferred from the file name. A file having an extension other than .vox or .wav is considered vce (flat). If no file type is specified and the file name does not have an extension, .vox is assumed.

-i voxindices

Number of indices in a newly created VOX file (48 to 6400). The default number of index entries in a VOX file is 250.

-m start:end

Specifies the message or messages to record. If only start is given, then only that message will be recorded. If end is also specified, then all messages from start to end inclusive will be recorded.

-p protocol

Waits for and connects to an incoming call. -p specifies the call control protocol. Default is LPS0. To use vcerec with a phone directly connected to a DID port on an AG-8 board, specify the NOCC protocol. For example, vcerec -pnocc {filename}.

-r seconds

Maximum seconds per message. If not specified, there is no limit.

-s [stream:]slot

Specifies the port (DSP) address. Default = 0:0.

For AG-24/30/48/60 boards, specify the MVIP stream and slot. For all other boards, you need to specify only the slot.

-x

Overwrite existing destination file. The default is to merge into an existing file, if any.

-?

Displays an on-screen list of program options.


Keyboard and Touch Tone Control

The following single-digit commands can be entered either with a keystroke or a touch tone:

Command

Description

1

Restart message

2

Next message

5

Pause/resume (toggle)

# or ESC

Exit

Featured Functions

vceClose, vceCreateFile, vceEraseMessage, vceGetContextInfo, vceGetHighMessageNumber, vceGetMessageSize, vceGetOpenInfo, vceOpenFile, vceRecord, vceRecordMessage vceSetCurrentMessage, vceSetPlayGain, vceSetPlaySpeed, vceSetPosition, vceStop

Description

Records one or more messages to a voice file. Use the keyboard or touch tones to control recording.

Examples

vcerec test.wav
re-record one message to test.wav

vcerec -pnocc -m0:9 digits
records 10 messages to digits.vox. Does not wait for an incoming call.

vcerec -14 -fVCE oki24.vox
records to a flat file named oki24.vox using OKI-24 encoding

vcerec -e?
displays the encoding values and their names.

9.3 Utilities

In addition to the demonstration programs presented in Section 9.2, the CT Access Voice Message service also provides the following utilities:

Utility

Description

mkprompt

Creates a prompt rules table.

testpmpt

Tests a prompt rules table.

voxinfo

Displays information about a VOX file.

9.3.1 Make Prompt: mkprompt

Name

mkprompt

Purpose

Creates a prompt rules table. Refer to Section 2.2.7, Prompt Builder for more information. Refer to Appendix E for information on adding or changing prompt rules.

Usage

mkprompt source[.ptx] [dest[.tbl]]

source[.ptx] - is the source text file to be compiled. If no extension is specified, .ptx is assumed.

[dest[.tbl]] - is an optional output file name. If no output file is specified, the source file name will be used with the .tbl extension. If no extension is specified, .tbl is assumed.

Description

mkprompt compiles prompt rule source files (.ptx) into prompt rule tables (.tbl).

The .tbl file is created only if there are no errors during the compile. If there are errors, they are reported with the line number where the error occurred.

Example

mkprompt american
Creates american.tbl from the source american.ptx file.

9.3.2 Test Prompt: testpmpt

Name

testpmpt

Purpose

Tests a prompt rules table. Refer to Section 2.2.7, Prompt Builder for more information. Refer to Appendix E for information on adding or changing prompt rules.

Usage

testpmpt [options]

where options are:

:
Option

Description

-p table

Prompt table name (assumes a .tbl extension). The default name is american.

-v voicefile

Name of voice file containing the message text (assumes a .vox extension). The default is the same name as the table.

-t text

Name of file containing prompts in text form (assumes a .txt extension). testpmpt does not look for a voice file if you specify a text file.

Description

testpmpt tests new prompt rules without having to pre-record the actual voice messages.

Once rules have been created or edited in a prompt rule text file (.ptx), they are compiled into a rule table (.tbl) file using mkprompt as described in Section 9.3.1.

A text description for each message should be created in a text file with the same root name as your .tbl file. The text description has the following format:

nn:description

where nn is the message number being described.

Use the vcecopy utility to copy the message text into the .vox file that contains, or that will contain, the recorded prompts.

When this utility is executed, the rule table and the voice or text file are loaded. You are prompted to enter a text string to be processed by the Prompt Builder.

Example


C> testpmpt -p american
CT Access Test Prompt Utility V 1.2 (Dec 11 1997)
Prompt table = american.tbl
Prompt text from american.vox
Enter text: 1/15/98
January fifteenth nineteen ninety eight
Enter text: 12345
twelve thousand three hundred forty five
Enter text: 12:34:34
twelve thirty four and thirty four seconds P.M.
Enter text: 12:34
twelve thirty four P.M.
Enter text: $416.23
four hundred sixteen dollars and twenty three cents
Enter text:

C>

9.3.3 VOX File Information: voxinfo

Name

voxinfo

Purpose

Display information about a VOX file.

Refer to Appendix D for more information about the VOX file format.

Usage

voxinfo filename

Description

Displays information about a specified NMS VOX file, including the header fields and details about each message.

The unit of size in VOX files is the frame. A frame represents 20 ms when speech is encoded with one of the Natural MicroSystems voice encodings, and 10 ms for other encodings.

Example


c:>voxinfo myprompt
NMS Voice File Information Utility CT Access Version 1.2 Dec 11 1997
Copyright (c) 1996 Natural MicroSystems Corp. All Rights Reserved.
File: MYPROMPT Compression rate: 2 (NMS-24)
Maximum number of indices: 48
Number of active indices: 4
Number of freed indices: 0
Number of indices in use: 4
Number of available indices: 44
Highest message number: 3
Total number of frames: 228 (5 seconds)
Total number of bytes: 14648
Number of active messages: 3
--------------------ACTIVE INDICES---------------------
Idx# Msg# Frames Bytes Start byte End byte
0 0 0x3b 0xe4a 0x200 - 0x1049
1 1 0x40 0xf80 0x104a - 0x1fc9
2 2 0x38 0xd90 0x1fca - 0x2d59
3 3 0x31 0xbde 0x2d5a - 0x3937
-------------MESSAGE INFORMATION----------------
Msg# Seconds Index Cnt Frame Cnt Byte Cnt
1 1.2 1 64 3968
2 1.1 1 56 3472
3 0.9 1 49 3038



(Page 1 of 1 in this chapter)


tech_support@nmss.com
Copyright © 1999, Natural MicroSystems, Inc. All rights reserved.