ALgetwidth(3dm)ALgetwidth(3dm)NAME
ALsetwidth, ALgetwidth - (obsolete) get/set the sample width setting in
an audio ALconfig structure
SYNOPSIS
#include <dmedia/audio.h>
long ALgetwidth(ALconfig config)
int ALsetwidth(ALconfig config, long samplesize)
PARAMETER
config expects an ALconfig structure, the returned value of a call
to ALnewconfig(3dm) or ALgetconfig(3dm).
samplesize expects a symbolic constant that identifies the size of an
audio sample. There are three symbolic constants defined
for this parameter.
AL_SAMPLE_8 indicates a one byte sample width in the range
-128 to 127.
AL_SAMPLE_16 indicates a two byte sample width in the range
-32768 to 32767.
AL_SAMPLE_24 indicates a 4 byte sample width in the range
-8388608 to 8388607.
DESCRIPTION
ALsetwidth and ALgetwidth are obsolete and are provided for backward
compatibility. The preferred functions are alSetWidth(3dm) and
alGetWidth(3dm).
ALsetwidth(3dm) sets the sample width setting in the ALconfig structure
config. Any audio port that you then configure using config will have
the audio sample size you specify with samplesize.
ALsetwidth(3dm) can fail for the following reasons:
AL_BAD_CONFIG config is invalid or null.
AL_BAD_WIDTH width is not one of the valid constants listed above.
ALgetwidth(3dm) returns the current sample width setting in the ALconfig
structure config.
ALgetwidth(3dm) can fail for the following reason:
AL_BAD_CONFIG config is invalid or null.
Page 1
ALgetwidth(3dm)ALgetwidth(3dm)
Both ALgetwidth(3dm) and ALsetwidth(3dm) are meaningful if you are using
the two's complement sample format (the default). If you are using
floating point data (see ALsetsampfmt(3dm)), calls to ALsetwidth(3dm)
will not affect the behavior of ALreadsamps(3dm) or ALwritesamps(3dm)
until you switch to two's complement sample format.
DIAGNOSTICS
Upon successful completion ALgetwidth(3dm) returns a long whose value is
one of the symbolic constants described above for samplesize. Otherwise,
ALgetwidth(3dm) returns -1 and and sets an error number. This error
number can be retrieved with oserror(3C).
ALsetwidth(3dm) returns 0 to the calling process when successful.
Otherwise, it returns -1 and sets an error number as described above.
SEE ALSOALnewconfig(3dm), ALgetconfig(3dm), ALopenport(3dm), ALsetconfig(3dm),
oserror(3C)
Page 2