CA_Get_Element_Count

Purpose

Returns the number of voice elements required to hold imported voice data.

Libraries

Blueworx Voice Response library (libvae.a)

Custom Server library (libca.a)

Syntax

#include "CA_access_db.h"
int CA_Get_Element_Count (
 EXT_VOICE_ST *ext_sp
);

Description

This subroutine calculates the number of voice elements required to hold the imported voice data, taking into account the sample width and the sampling rate of the input voice data. This value can then be used to allocate a buffer for the data supplied from a subsequent call to CA_Import_Voice(). The number of voice elements required is the same whether or not the voice data will be compressed when it is imported, the actual size of the buffer being either:

Parameters

ext_sp
A pointer to an EXT_VOICE_ST structure as defined in EXT_VOICE_ST. This defines the format of the input voice data.

Return codes

>0
Successful (number of voice elements required).
0
The input data is too small to create a voice element (less than 20 milliseconds).
-1
Unsuccessful (global error number CA_errno is set to indicate the error)

Error names

CA_NOT_INIT
CA_INV_ADDR
CA_INV_SAMPLE_WIDTH
CA_INV_SAMPLING_RATE
CA_INV_VOICE_FORMAT
CA_INV_VOICE_ORDER
CA_TERMINATING

Related information

CA_Import_Voice().