SPBMilliSecondsToBytes
You can use the SPBMilliSecondsToBytes 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
The SPBMilliSecondsToBytes function reports how many bytes are required to store a recording of duration milliseconds, given the input device's current sample rate, sample size, number of channels, and compression factor.
SPECIAL CONSIDERATIONS
You can call the SPBMilliSecondsToBytes function at interrupt time.
ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for the SPBMilliSecondsToBytes function are
| Trap macro | Selector |
| _SoundDispatch | $04400014 |
RESULT CODES
| noErr | 0 | No error |
| siBadSoundInDevice | -221 | Invalid sound input device |