CA_Export_Voice()

Purpose

Converts voice data from Blueworx Voice Response format to a standard format.

Libraries

Blueworx Voice Response library (libvae.a)

Custom Server library (libca.a)

Syntax

#include "CA_header.h"
#include "CA_access_db.h"
int CA_Export_Voice (
 EXT_VOICE_ST         *ext_sp,
 INT_VOICE_ST         *int_sp
);

Description

This subroutine converts voice data, for example, the output from CA_Get_Segment(), from the internal format used by Blueworx Voice Response into a standard format, decompressing it if necessary. The INT_VOICE_ST structure defines the format of the input voice elements, and the EXT_VOICE_ST structure defines the required format of the output voice data.

The calling routine must calculate the size of buffer required for the output data from the number of voice elements to be converted. Each exported voice element holds 0.2 seconds of voice, which corresponds to 1600 output bytes for 8-bit samples at 8000 Hz, whether the source is compressed or uncompressed. Exported voice data is uncompressed. If the required sampling rate is greater than 8000 Hz, or the required sample width is greater than 8 bits (for PCM two's complement (FORMAT_TWOC), signed (FORMAT_SMAG), or unsigned (FORMAT_MAG) formats, it must be 16 bits), the calling routine should account for this when calculating the buffer size.

Parameters

ext_sp
A pointer to a EXT_VOICE_ST input structure filled in as described in EXT_VOICE_ST.
int_sp
A pointer to an INT_VOICE_ST input structure filled in as described in INT_VOICE_ST.

Return codes

0
Successful; length of voice data returned
-1
Unsuccessful (global error number CA_errno is set to indicate the error)

Error names

CA_INV_ADDR
CA_INV_COMPRESSION_TYPE
CA_INV_SAMPLE_WIDTH
CA_INV_SAMPLING_RATE
CA_INV_TOTAL_ELEMENTS
CA_INV_VOICE_ELEMENT
CA_INV_VOICE_FORMAT
CA_INV_VOICE_ORDER
CA_MALLOC_FAILED
CA_NOT_INIT
CA_TERMINATING

Related information

CA_Get_Audio_Name(), CA_Get_Element_Info(), CA_Get_Greeting(), CA_Get_Segment(), CA_Get_Voice_Msg(), CA_Import_Voice().