Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

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

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

AGetAFileAttributes(3X)

ABestAudioAttributes(3X)

NAME

ABestAudioAttributes − get default audio attribute setting for specified server

SYNOPSIS

#include <Alib.h> AudioAttributes ∗
ABestAudioAttributes (

Audio ∗  audio );

DESCRIPTION

ABestAudioAttributes() returns a pointer to an AudioAttributes structure containing the default attributes for the audio server associated with the audio connection.  These attributes are the "best" for the audio server, meaning that they put the least load on the CPU.  The "best" attributes for listening pleasure may be different.  The application may use the returned attributes pointer directly in subsequent audio operation calls. 

Changes should not be made to the AudioAttributes structure; rather, the application should copy the structure and make changes in the copy, as shown in the example below. 

audio specifies the Audio structure associated with this connection. 

RETURN VALUE

Upon successful completion, ABestAudioAttributes() returns a pointer to an AudioAttributes structure. 

ERRORS

ABestAudioAttributes() does not return an error status.  Note that the application program may crash if audio does not point to a valid Audio structure. 

EXAMPLES

The following example shows a call to ABestAudioAttributes() to get the pointer to the default audio attributes. 

Audio ∗ audio;  /∗ audio connection ∗/

AudioAttributes ∗ bestAttr;  /∗ default attributes ∗/
.
.
.

/∗ get default audio attributes ∗/

bestAttr = ABestAudioAttributes (audio);

The next example shows how to get a copy of the default attributes and make a change to a field in the copy. The program assigns the contents at the returned pointer (the audio attributes) to myAttr and then sets the value of the sampled_attr field in myAttr to ADFALaw. 

Audio ∗ audio;  /∗ audio connection ∗/

AudioAttributes myAttr;  /∗ my copy of default attributes ∗/
.
.
.

/∗ get copy of audio attributes; change the copy ∗/

myAttr = ∗ ABestAudioAttributes (audio);

myAttr.attr.sampled_attr.data_format = ADFALaw;

NOTES

ABestAudioAttributes() is a convenience function that enables the client program to examine a component of the internal Audio structure that is created by AOpenAudio().  The contents of the structure should be treated as read-only. 

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

ABestAudioAttributes() was developed by HP. 

SEE ALSO

AGetAFileAttributes(3X). 

Hewlett-Packard Company  —  Audio Library: February, 1995

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