AChoosePlayAttributes(3X)
NAME
AChoosePlayAttributes − select hardware-supported attributes to use when playing a file or stream
SYNOPSIS
#include <Alib.h> void
AChoosePlayAttributes (
Audio ∗ audio,
AudioAttributes ∗ src_attributes,
AudioAttrMask user_mask,
AudioAttributes ∗ attributes,
AByteOrder ∗ byte_order,
long ∗ status_return );
DESCRIPTION
AChoosePlayAttributes() selects hardware-supported attributes to use when playing an existing file or a stream. The attributes of the source will be used where possible, or else the values closest to the source attributes that are supported in the hardware.
audio specifies the Audio structure associated with this connection.
src_attributes specifies the audio attributes of the source stream.
user_mask specifies which of the audio attributes in the attributes structure have been supplied by the user (mask bit set to 1). These attributes will be checked for validity, but will not be changed.
The mask is the bitwise inclusive OR of one or more of the mask values listed in the Structures section.
attributes is an input/output parameter that contains user-supplied attributes (if any) as indicated by user_mask. AChoosePlayAttributes() will write appropriate values to those attributes not supplied by the user.
byte_order receives the byte ordering for hardware. One of the following values:
ALSBFirst − Least significant byte first.
AMSBFirst − Most significant byte first.
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.
STRUCTURES
The following are defined in /opt/audio/include/Alib.h.
typedef long AudioAttrMask;
#define ASDataFormatMask ( 1 << ASAFDataFormat )
#define ASBitsPerSampleMask ( 1 << ASAFBitsPerSample )
#define ASSamplingRateMask ( 1 << ASAFSamplingRate )
#define ASChannelsMask ( 1 << ASAFChannels )
#define ASInterleaveMask ( 1 << ASAFInterleave )
#define ASDurationMask ( 1 << ASAFDuration )
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 (for example, bits per sample does not agree with the selected data type or interleave is not 1 for a stereo file).
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
AChoosePlayAttributes() was developed by HP.
SEE ALSO
Hewlett-Packard Company — Audio Library: February, 1995