alGetFloatMax(3dm) alGetFloatMax(3dm) NAME alGetFloatMax, alSetFloatMax - get/set the maximum value of floating point sample data. SYNOPSIS #include <dmedia/audio.h> double alGetFloatMax(ALconfig config) int alSetFloatMax(ALconfig config, double maximum_value) PARAMETER config expects an ALconfig structure, the returned value of a call to alNewConfig(3dm) or alGetConfig(3dm). maximum_value expects an IEEE double precision floating point value which defines the range of the floating point data for the alReadFrames(3dm) or alWriteFrames(3dm) functions. DESCRIPTION alSetFloatMax simultaneously sets the upper and lower bounds of the data read from a port with the alReadFrames(3dm) function or written with the alWriteFrames(3dm) function. This is only meaningful if the sample format is single- or double-precision floating-point; see alSetSampFmt(3dm) for more information. The data transferred into a program with alReadFrames(3dm) will be scaled to the range (-maximum_value, maximum_value), where the maximum value of the input data (32767 in the case of 16-bit input) will correspond to maximum_value. Likewise, the value -32768 will correspond to -maximum_value in this case. Data output with alWriteFrames(3dm) or alWriteBuffers(3dm) should fall in the range (-maximum_value, maximum_value). Normally, the AL will automatically limit output to this range; however, this can be disabled with alSetLimiting(3dm) if the application knows its data is always in range. alSetFloatMax is only meaningful when the sample format for config is set to AL_SAMPFMT_FLOAT or AL_SAMPFMT_DOUBLE. See alSetSampFmt(3dm) for more details regarding setting the sample data format. alGetFloatMax returns the current value of the floating-point scale in config. DIAGNOSTICS Upon successful completion, alSetFloatMax returns 0. Otherwise, alSetFloatMax returns -1 and sets an error number which can be retrieved with oserror(3C). alSetFloatMax can fail for the following reasons: AL_BAD_CONFIG config is invalid or null. AL_BAD_FLOATMAX maximum_value is zero. alGetFloatMax returns 0 in the case of failure and sets an error number which can be retrieved with oserror(3C). When successful, alGetFloatMax returns the (strictly positive) current value of the floating-point scale in config. alGetFloatMax can fail for the following reason: AL_BAD_CONFIG config is invalid or null. SEE ALSO alNewConfig(3dm), alGetConfig(3dm), alOpenPort(3dm), alSetConfig(3dm), alSetSampFmt(3dm), alSetLimiting(3dm), oserror(3C) Page 2