Important: Inside Macintosh: Sound is deprecated as of Mac OS X v10.5. For new audio development in Mac OS X, use Core Audio. See the Audio page in the ADC Reference Library.
UnsignedFixMulDiv
You can use theUnsignedFixMulDiv
function to perform multiplications and divisions on unsigned fixed-point numbers. You'll typically use it to calculate sample rates.
FUNCTION UnsignedFixMulDiv (value: UnsignedFixed; multiplier: UnsignedFixed; divisor: UnsignedFixed): UnsignedFixed;
value
- The value to be multiplied and divided.
multiplier
- The multiplier to be applied to the value in the
value
parameter.divisor
- The divisor to be applied to the value in the
value
parameter.DESCRIPTION
TheUnsignedFixMulDiv
function returns the fixed-point number that is the value of thevalue
parameter, multiplied by the value in themultiplier
parameter and divided by the value in thedivisor
parameter. Note thatUnsignedFixMulDiv
performs both operations before returning. If you want to perform only a multiplication or only a division, pass the value $00010000 for whichever parameter you want to ignore. For example, to determine the sample rate that is twice that of the 22 kHz rate, you can useUnsignedFixMulDiv
as follows:
myNewRate := UnsignedFixMulDiv(rate22kHz, $00020000, $00010000);Similarly, to determine the sample rate that is half that of the 44 kHz rate, you can useUnsignedFixMulDiv
as follows:
myNewRate := UnsignedFixMulDiv(rate44kHz, $00010000, $00020000);SPECIAL CONSIDERATIONS
TheUnsignedFixMulDiv
function is available only in versions 3.0 and later of the Sound Manager.