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 theUnsignedFixMulDivfunction 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
valueparameter.divisor- The divisor to be applied to the value in the
valueparameter.DESCRIPTION
TheUnsignedFixMulDivfunction returns the fixed-point number that is the value of thevalueparameter, multiplied by the value in themultiplierparameter and divided by the value in thedivisorparameter. Note thatUnsignedFixMulDivperforms 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 useUnsignedFixMulDivas follows:
myNewRate := UnsignedFixMulDiv(rate22kHz, $00020000, $00010000);Similarly, to determine the sample rate that is half that of the 44 kHz rate, you can useUnsignedFixMulDivas follows:
myNewRate := UnsignedFixMulDiv(rate44kHz, $00010000, $00020000);SPECIAL CONSIDERATIONS
TheUnsignedFixMulDivfunction is available only in versions 3.0 and later of the Sound Manager.