Carbon


SPBBytesToMilliseconds

Header: Sound.h Carbon status: Supported

Determines the maximum duration of a recording that can fit in a buffer of a certain size.

OSErr SPBBytesToMilliseconds (
    SInt32 inRefNum, 
    SInt32 *byteCount
);
Parameter descriptions
inRefNum

The device reference number of the sound input device, as obtained from the SPBOpenDevice function.

byteCount

A pointer to a value in bytes. On return, the number of milliseconds of recording on the device specified by the inRefNum parameter that would be necessary to fill a buffer of such a size.

function result

A result code.

DISCUSSION

The SPBBytesToMilliSeconds function reports how many milliseconds of audio data can be recorded in a buffer that is byteCount bytes long, given the input device’s current sample rate, sample size, number of channels, and compression factor.

SPECIAL CONSIDERATIONS

You can call the SPBBytesToMilliSeconds 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)