Carbon


SPBRecord

Header: Sound.h Carbon status: Supported

Records audio data into memory, either synchronously or asynchronously.

OSErr SPBRecord (
     inParamPtr, 
    Boolean asynchFlag
);
Parameter descriptions
inParamPtr

A pointer to a sound input parameter block.

asynchFlag

A Boolean value that specifies whether the recording occurs asynchronously (TRUE) or synchronously (FALSE).

function result

A result code. The value that the error field of the parameter block contains when recording finishes.

DISCUSSION

You specify values and receive return values in the sound input parameter block. The relevant fields of the sound input parameter block are:

The SPBRecord function starts recording into memory from a device specified in a sound input parameter block. The sound data recorded is stored in the buffer specified by the bufferPtr and bufferLength fields of the parameter block. Recording lasts the longer of the times specified by the count and milliseconds fields of the parameter block, or until the buffer is filled. Recording is asynchronous if the asynchFlag parameter is TRUE and the specified sound input device supports asynchronous recording.

If the bufferPtr field of the parameter block contains NULL, then the count, milliseconds, and bufferLength fields are ignored, and the recording continues indefinitely until you call the SPBStopRecording function. In this case, the audio data is not saved anywhere; this feature is useful only if you want to do something in your interrupt function and do not want to save the audio data. However, if the recording is synchronous and bufferPtr is NULL, SPBRecord returns the result code siNoBufferSpecified.

This low-level function does not display the sound recording dialog box to the user.

SPECIAL CONSIDERATIONS

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