Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

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

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

AOpenAudio(3X)

AGetSilenceValue(3X)

NAME

AGetSilenceValue − get a silence value for a given data format

SYNOPSIS

#include <Alib.h> long
AGetSilenceValue (

Audio ∗  audio,

ADataFormat data_format,

long ∗  significant_bytes_return,

long ∗  status_return );

DESCRIPTION

AGetSilenceValue() returns the appropriate silence value for the given data format. (Some data formats do not use zero to correspond to silence.)  The silence value can be used for clearing or padding an audio file or buffer. 

audio specifies the Audio structure associated with this connection. 

data_format the data format for which a silence value will be returned.  One of the following values:

ADFUnknown − Have the Audio Library determine the data format. 

ADFMuLaw − MuLaw format

ADFALaw − ALaw format

ADFLin16 − Linear16 (16-bit signed) format

ADFLin8 − Linear8 (8-bit signed) format

ADFLin8Offset − Linear8Offset (8-bit unsigned)

significant_bytes_return
receives the number of bytes of the returned long that constitute the actual silence value. Currently, all silence values are one byte in length. The application will thus need to cast the silence value to an unsigned char before using it.

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. 

RETURN VALUE

Upon successful completion, AGetSilenceValue() returns a long integer containing the silence value in the least significant bytes. 

ERRORS

If status_return is not set to NULL, it can return the following value:

0  AENoError No error - the call completed successfully. 

EXAMPLE

The following example gets the silence value for MuLaw data. 

Audio ∗ audio;  /∗ audio connection ∗/

ADataFormat data_format;  /∗ data format of interest ∗/

long significant_bytes;  /∗ number valid bytes returned ∗/

unsigned char silence_value;  /∗ pads audio file or buffer with silence ∗/

long status;  /∗ status ∗/
.
.
.

/∗ get silence value for MuLaw data ∗/

data_format = ADFMuLaw;

silence_value = (unsigned char)AGetSilenceValue(audio, data_format,

    &significant_bytes, &status);

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

AGetSilenceValue() was developed by HP. 

SEE ALSO

AOpenAudio(3X). 

 

Hewlett-Packard Company  —  Audio Library: February, 1995

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