Carbon


SPBMillisecondsToBytes

Header: Sound.h Carbon status: Supported

Determines how many bytes a recording of a certain duration will use.

OSErr SPBMillisecondsToBytes (
    SInt32 inRefNum, 
    SInt32 *milliseconds
);
Parameter descriptions
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 return, a pointer to 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.

function result

A result code.

DISCUSSION

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.

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)