Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ AConvertBuf(3X) — HP-UX ANSI C A.10.11

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ASetupConversion(3X)

AEndConversion(3X)

ACalculateLength(3X)

AConvertBuffer(3X)

NAME

AConvertBuffer − convert a buffer of data

SYNOPSIS

#include <Alib.h> void
AConvertBuffer (

Audio ∗  audio,

AConvertParams ∗  convert_params,

char ∗  src_buffer,

long src_buffer_size,

char ∗  dest_buffer,

long dest_buffer_size,

long ∗  bytes_read,

long ∗  bytes_written,

long ∗  status_return );

DESCRIPTION

AConvertBuffer() converts the data in src_buffer according to the attributes specified in convert_params and puts the results in dest_buffer. Conversion will stop when either all the data in the source buffer has been converted or the destination buffer is full. If the destination buffer fills up before all the source data is converted, bytes_read will be less than src_buffer_size. If the source buffer empties before the destination buffer is full, bytes_written will be less than dest_buffer_size.

The source and destination buffers must have attributes that are recognized by the Audio Library (for example, sample rate and data format). 

audio specifies the Audio structure associated with this connection. 

convert_params Pointer to a structure describing conversion source and destination; returned by ASetupConversion(). 

src_buffer data to be converted. 

src_buffer_size size in bytes of the source buffer, src_buffer.

dest_buffer the destination buffer; receives the converted data. 

dest_buffer_size size in bytes of the destination buffer. 

bytes_read receives the number of bytes read. 

bytes_written receives the number of bytes written. 

status_return receives the returned status of the operation, unless this parameter is passed in as a NULL pointer.  If status_return is set to NULL, Alib will do the error handling. 

ERRORS

If status_return is not set to NULL, it can return one of the following values:

0   AENoError No error - the call completed successfully. 

13  AEBadAttribute The specified audio attributes structure contains an unsupported or inconsistent value. 

17  AEOutOfMemory Alib attempted to malloc space but failed. 

NOTE

In order to ensure that the compiler finds the Audio Library (libAlib.sl) and the Alib.h header file, you must add the following switches:

-L /opt/audio/lib
-I/opt/audio/include

DEPENDENCIES

This function belongs to the Audio Library of functions that manage connections to an audio server.  The audio server must run on a system that has audio hardware. To find out whether or not your system has audio hardware, refer to Using the Audio Developer’s Kit or the online help for the Audio control panel.  For information about the audio capabilities of a particular system use the online example audioinfo.c. 

AUTHOR

AConvertBuffer() was developed by HP. 

SEE ALSO

ASetupConversion(3X), AEndConversion(3X), ACalculateLength(3X). 

Hewlett-Packard Company  —  Audio Library: February, 1995

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026