CA_Get_Audio_Name()

Purpose

Retrieves an audio name.

Libraries

Blueworx Voice Response library (libvae.a)

Custom Server library (libca.a)

Syntax

#include "CA_header.h"
#include "CA_access_db.h"
int CA_Get_Audio_Name (
 AUDIO_NAME_PARM_ST  *audio_name_parm_sp,
 unsigned long       start_element,
 unsigned long       element_count,
 unsigned char       *voice_data
);

Description

This subroutine retrieves an audio name from the Blueworx Voice Response database, based on the information provided in the AUDIO_NAME_PARM_ST input structure.

The calling routine should first use the CA_Get_Audio_Name_Info() subroutine to determine the size of buffer required to hold the complete audio name in the format in which it was recorded. For information on how to calculate the size of buffer required, see AUDIO_NAME_INFO_ST. Note that an uncompressed audio name occupies approximately 5 times more space than it would do if it was compressed.

The calling routine can then specify the starting voice element and the number of voice elements to retrieve from the database. The calling routine is responsible for passing the appropriate start element number so that the voice data is kept in sequence.

Parameters

audio_name_parm_sp
A pointer to an AUDIO_NAME_PARM_ST input structure that is filled in (see AUDIO_NAME_PARM_ST).
start_element
The number of the first voice element. You can specify any integer from 1 through total_elements (see AUDIO_NAME_INFO_ST).

To retrieve the entire audio name with a single call to this subroutine, specify the value 1.

element_count
The number of voice elements to retrieve. You can specify any integer from 1 through total_elements (see AUDIO_NAME_INFO_ST).

To retrieve the entire audio name with a single call to this subroutine, specify the same as the value of total_elements.

voice_data
The address of the previously declared space to hold the voice data.

Return codes

0
Successful; some voice elements were retrieved. If the number of elements retrieved is not equal to element_count, CA_errno is set to CA_END_OF_DATA_REACHED.
-1
Unsuccessful (global error number CA_errno is set to indicate the error)

Error names

CA_ACCESS_NOBUFS
CA_AUDIO_NAME_NOT_FOUND
CA_END_OF_DATA_REACHED
CA_INV_ADDR
CA_INV_COMPRESSION_TYPE
CA_INV_MAILBOX_ID
CA_INV_PROFILE_ID
CA_INV_ELEMENT_COUNT
CA_INV_REQUEST
CA_INV_START_ELEMENT
CA_NO_MSG_RECV
CA_NOT_INIT
CA_OM_REQ_FAILED
CA_REQ_FAILED
CA_TERMINATING

Related information

CA_Create_Audio_Name(), CA_Delete_Audio_Name(), CA_Export_Voice(), CA_Get_Audio_Name_Info().