AUDIO_CONVERT(3)

NAME
audio_convert, audio_d2c, audio_d2s, audio_d2l, audio_c2d, audio_s2d, audio_l2d - floating-point data conversions

DISCLAIMER

The manual pages, header files, and object library associated with /usr/demo/SOUND/libaudio.a are furnished on an AS IS basis as a preliminary interface to several useful audio data-processing capabilities. A future release of the operating system may redefine the syntax or semantics of some of the functions described herein.

SYNOPSIS
#include <multimedia/libaudio.h>

char audio_d2c(dbl)
double dbl;

short audio_d2s(dbl)
double dbl;

long audio_d2l(dbl)
double dbl;

double audio_c2d(pcm)
char pcm;

double audio_s2d(pcm)
short pcm;

double audio_l2d(pcm)
long pcm;

DESCRIPTION
These macros are designed to facilitate conversion between integer and floating-point PCM audio data.

audio_c2d(), audio_s2d(), and audio_l2d() convert 8, 16, and 32 bit PCM signed integers to floating-point values that range between -1. and +1. In order to preserve symmetry around 0, the singular value represented by the most negative integer (i.e., -128, -32768, -2147483648) is clipped to -1.

audio_d2c(), audio_d2s(), and audio_d2l() convert floating-point data to PCM signed integers of 8, 16, or 32 bit precision, respectively. Floating-point values outside the range of ±1. are clipped at full range in the appropriate precision.

SEE ALSO
audio_ulaw2linear(3).