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.
SPBMilliSecondsToBytes
You can use theSPBMilliSecondsToBytesfunction to determine how many bytes a recording of a certain duration will use.
FUNCTION SPBMilliSecondsToBytes (inRefNum: LongInt; VAR milliseconds: LongInt): OSErr;
inRefNum- The device reference number of the sound input device, as obtained from the
SPBOpenDevicefunction.milliseconds- On entry, the duration of the recording in milliseconds. On exit, the number of bytes that sampled-sound data would occupy for a recording of the specified duration on the device specified by the
inRefNumparameter.DESCRIPTION
TheSPBMilliSecondsToBytesfunction reports how many bytes are required to store a recording of durationmilliseconds, given the input device's current sample rate, sample size, number of channels, and compression factor.SPECIAL CONSIDERATIONS
You can call theSPBMilliSecondsToBytesfunction at interrupt time.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for theSPBMilliSecondsToBytesfunction are
Trap macro Selector _SoundDispatch $04400014 RESULT CODES
noErr 0 No error siBadSoundInDevice -221 Invalid sound input device