Table of Contents Index NMS Glossary Previous Page Next Page Version


Chapter 1

Overview of the Voice Message Service


1.1 Introduction
1.2 Voice Message Service Features
1.2.1 Voice File Types
1.2.2 Voice Encoding Formats
1.2.3 Messages
1.3 Setting Up the Natural Access Environment
1.3.1 Initializing Natural Access
1.3.2 Creating Event Queues and Contexts
1.3.3 Opening Services
1.3.4 Linking with the Voice Message Service

1.1 IntroductionTop of Page

The Voice Message Service Developer's Reference Manual provides

This manual defines telephony terms where applicable, but assumes that you are familiar with telephony concepts. It also assumes that you are familiar with the C programming language.

Read the Natural Access Developer's Reference Manual before using this manual. The Natural Access Developer's Reference Manual contains detailed information on Natural Access concepts, architecture, and application development. This information must be fully understood before you develop a voice application using Natural Access.

1.2 Voice Message Service FeaturesTop of Page

The Voice Message service is a Natural Access service for developing voice applications. You must have Natural Access installed on your system to build applications using the Voice Message service. For detailed information about Natural Access, refer to the Natural Access Developer's Reference Manual.

The Voice Message service

Refer to Chapter 5 for demonstration programs using the Voice Message service play and record functions.

1.2.1 Voice File TypesTop of Page

The Voice Message service supports the following voice file types:

1.2.2 Voice Encoding FormatsTop of Page

When recording speech files, you must select an encoding format. The primary issue to consider when selecting a format is the compression ratio versus fidelity. More aggressive compression requires less disk space and reduces host-to-board loading, but it uses more DSP resources.

On heavily loaded systems, the throughput requirements between the host and the board may cause gaps in the speech record or playback. This is called an underrun condition. Greater compression may be necessary in this case to eliminate the problem.

The ADI service opened on the same context determines what type of voice encoding is supported. For information on attaching the ADI service, refer to the ADI Service Developer's Manual.

AG and CG boards support the following encoding formats:

Each encoding format has a minimum data block size, called a frame. For NMS boards, a frame corresponds to 10 or 20 milliseconds of speech, depending on the encoding. All messages in a voice file must have the same encoding.

The encodings refer to the data going to and from the host, typically stored in a voice file. Except for VCE_ENCODE_NMS_64, this host encoding is independent of the line encoding, which is always either mu-law or A-law, depending on how the board is configured when it is initialized.

Note: The ADI service has equivalent encoding formats which begin with ADI_.

For a complete list of the Natural Access encoding formats, and the encoding and WAVE information, refer to Appendix E.

1.2.3 MessagesTop of Page

A voice file or memory block can contain zero, one, or multiple messages, depending on the file type. A message is a logical, contiguous block of speech identified by an unsigned number. Messages can be created in an open file or memory block by recording or copying to it. Unstructured formats (flat files, memory) contain only message zero (0) when first opened. Other messages can be defined by using vceDefineMessages.

The file type determines the range of valid message numbers.
File Type

Range of Valid Message Numbers

VOX

0 to 32,767

Flat

0 to 65,535

WAVE

0 only

Memory

0 to 65,535

All unused (or deleted) message numbers in the valid range refer to zero-length messages and do not result in an error when referenced.

The special message number VCE_ALL_MESSAGES allows you to operate on all messages in a file or memory block as one message. Use this to copy all messages, play all messages, or erase all messages. You cannot record or write to this message number.

1.3 Setting Up the Natural Access EnvironmentTop of Page

Before calling functions from the Voice Message library, the application must initialize Natural Access and open the Voice Message service by performing the following steps:

  1. Initialize Natural Access for the process.

    
    
  2. Create event queues.

    
    
  3. Create contexts and attach them to an event queue.

    
    
  4. Open services on each context.

1.3.1 Initializing Natural AccessTop of Page

Register services in the call to ctaInitialize by specifying the service and service manager names. Only the services initialized in the call to ctaInitialize can be opened by the application. Service managers are dynamic link libraries (DLL) in Windows NT and Windows 2000, and shared libraries in UNIX that are linked to the application.

1.3.2 Creating Event Queues and ContextsTop of Page

After initializing Natural Access, create the event queues and the contexts. Create one or more event queues by calling ctaCreateQueue. Specify which service managers will be attached to each queue. VCEMGR is the Voice Message service's service manager. When you attach or bind a service manager to an event queue, you make that service manager available to the event queue.

Create a context by calling ctaCreateContext. You provide the queue handle (ctaqueuehd) returned from ctaCreateQueue. All events for services on the context are received in the specified event queue.

ctaCreateContext returns a context handle (ctahd). The application supplies the context handle when invoking Voice Message service functions. Events communicated back to the application are also associated with the context.

Refer to the Natural Access Developer's Reference Manual for details on the programming models created by the use of contexts and event queues.

1.3.3 Opening ServicesTop of Page

Open services on a context by calling ctaOpenServices, and passing a context handle and a list of service descriptors. The service descriptor specifies the name of the service, the service manager, and any service-specific arguments (the VCE service has no service-specific arguments).

1.3.4 Linking with the Voice Message ServiceTop of Page

The Voice Message service contains two components, the Voice Message service interface (vceapi) and the Voice Message service implementation (vcemgr). When building a new Natural Access application that uses the Voice Message service, link to vceapi.lib (under UNIX, libvceapi.so). The vcemgr.lib (under UNIX, libvcemgr.so) is dynamically loaded at runtime.

In earlier releases of Natural Access, both the interface and implementation components were shipped in a single library, the vcemgr library. It is strongly recommended that you modify makefiles of existing applications to link with vceapi.lib (libvceapi.so).

See the Natural Access Service Writer's Manual for more details about service implementation.



Table of Contents Index NMS Glossary Previous Page Next Page Version


Want to send us feedback on our documentation? Email: Tech_Pubs@nmss.com
Copyright © 2001, Natural MicroSystems, Inc. All rights reserved.