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 theSPBMilliSecondsToBytes
function 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
SPBOpenDevice
function.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
inRefNum
parameter.DESCRIPTION
TheSPBMilliSecondsToBytes
function 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 theSPBMilliSecondsToBytes
function at interrupt time.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for theSPBMilliSecondsToBytes
function are
Trap macro Selector _SoundDispatch $04400014 RESULT CODES
noErr 0 No error siBadSoundInDevice -221 Invalid sound input device