To query a voice segment in the Blueworx Voice Response database, use the CA_Get_Segment_Info() subroutine. This checks that the segment exists, and returns the size of the voice data. You can use this information to calculate the size of the buffer needed to hold the voice data, then retrieve the data using the CA_Get_Segment() subroutine.
To create or replace a voice segment in the Blueworx Voice Response database, use the CA_Create_Segment() subroutine. To delete a voice segment, use CA_Delete_Segment().
Voice segments can be recorded in compressed or uncompressed format. The CA_Get_Segment() and CA_Create_Segment() subroutines handle voice segments as a series of voice elements of length 352 bytes (compressed) or 1760 bytes (uncompressed), each of which corresponds to 0.2 seconds of recorded voice. Therefore, you need to be aware of whether the voice data is compressed or uncompressed when calculating the buffer size needed to extract a voice segment, or the number of voice elements needed to hold a voice segment.
For more information about voice segments, see the Blueworx Voice Response for AIX: Application Development using State Tables information.