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 Introduction
- The Voice Message Service Developer's Reference Manual provides
- A reference to functions, errors, events, and reasons
- 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 Features
- 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
- Supports NMS VOX files, WAVE files, and flat (unformatted) files.
- Provides more advanced functions that enable you to play a list of
concatenated messages and to assign message numbers to segments of an
open file or a memory block.
- Uses the ADI service play and record functions.
To use the Voice Message service with the ADI service, open both services on the same context. Refer to the ADI Service Developer's Manual for more information about the ADI service play and record functions.
- Refer to Chapter 5 for demonstration programs using the Voice Message service play and record functions.
1.2.1 Voice File Types
- The Voice Message service supports the following voice file types:
- Waveform Audio File Format (WAVE) files. Refer to the Microsoft
Windows MultiMedia Programmer's Reference Manual for information
about the WAVE file format.
- Flat files, which contain no header or format.
1.2.2 Voice Encoding Formats
- 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:
- G.726-compliant ADPCM
- OKI ADPCM (6 and 8 kHz)
- Mu-law and A-law PCM
- 8-bit and 16-bit linear PCM at 11 kHz
- 16-bit linear PCM at 8 kHz
- IMA ADPCM (6 and 8 kHz)
- Microsoft GSM (full rate) (AG 2000, AG 4000, AG 4000C only). Microsoft
GSM is also supported on the CG 6000C board
Note: If you are using an AG or CG board, refer to the DSP files appendix in the ADI Service Function Reference Manual for a list of DSP files that are required for each encoding format.
- 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 Messages
- 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.
- 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 Environment
- 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:
- Initialize Natural Access for the process.
- Create event queues.
- Create contexts and attach them to an event queue.
- Open services on each context.
1.3.1 Initializing Natural Access
- 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 Contexts
- 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 Services
- 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 Service
- 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.
Version
Want to send us feedback on our documentation? Email: Tech_Pubs@nmss.com
Copyright © 2001, Natural MicroSystems, Inc. All rights
reserved.