ALgetwidth(3dm) ALgetwidth(3dm)
ALsetwidth, ALgetwidth - (obsolete) get/set the sample width setting in
an audio ALconfig structure
#include <dmedia/audio.h>
long ALgetwidth(ALconfig config)
int ALsetwidth(ALconfig config, long samplesize)
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.
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.
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.
ALnewconfig(3dm), ALgetconfig(3dm), ALopenport(3dm), ALsetconfig(3dm),
oserror(3C)
alGetWidth(3dm) alGetWidth(3dm)
alSetWidth, alGetWidth - get/set the wordsize for integer audio data
#include <dmedia/audio.h>
int alGetWidth(ALconfig config)
int alSetWidth(ALconfig config, int samplesize)
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
integer audio sample. There are three symbolic constants
defined for this parameter.
AL_SAMPLE_8 indicates a one byte (signed char) sample width
in the range -128 to 127.
AL_SAMPLE_16 indicates a 16-bit (short) sample width in the
range -32768 to 32767.
AL_SAMPLE_24 indicates a 32-bit (int) sample width in the
range -8388608 to 8388607. Note that though a 32-bit integer
is used for ease of packing, the audio system will limit
values to 24 bits; hence the name AL_SAMPLE_24.
alGetWidth returns the current sample width setting in the ALconfig
structure config.
alSetWidth 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.
Both alGetWidth and alSetWidth are only meaningful if you are using an
integer sample format (the default). If you are using a floating point
format (see alSetSampFmt(3dm)), the wordsize is implicit in the selected
format; calls to alSetWidth will not affect the behavior of
alReadFrames(3dm) or alWriteFrames(3dm) until you switch to an integer
sample format.
Upon successful completion alGetWidth returns a int whose value is one of
the symbolic constants described above for samplesize. Otherwise,
alGetWidth returns -1 and and sets an error number. This error number can
be retrieved with oserror(3C).
Page 1
alGetWidth(3dm) alGetWidth(3dm)
alGetWidth can fail for the following reason:
AL_BAD_CONFIG config is invalid or null.
alSetWidth returns 0 if successful. Otherwise, it returns -1 and sets an
error number which can be retrieved with oserror(3C).
alSetWidth 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.
alNewConfig(3dm), alGetConfig(3dm), alOpenPort(3dm), alSetConfig(3dm),
oserror(3C)
PPPPaaaaggggeeee 2222 [ Back ]
|