SndRecord
ProcPtr filterProc; a pointer to a procedure Point corner; coordinates of the upper-left corner of the dialog box
OSType quality; the desired quality of the recorded sound Handle * sndHandle; a handle to some storage space The SndRecord function records sound into memory. The recorded data has the structure of a format 1 'snd ' resource and can later be played using
SndPlay or can be stored as a resource. By using this high-level routine, you can be assured that your application will present a user interface that is
consistent with that displayed by other applications doing sound input. Both
sound input hardware currently selected in the Sound control panel. filterProc determines how user actions in the dialog box are filtered (and
hence is similar to the filterProc parameter specified in a call to
ModalDialog). By specifying your own filter procedure, you can override or add to the default actions of the items in the dialog box. If
filterProc is not NULL, SndRecord filters events by calling the procedure that filterProc points to
corner gives the horizontal and vertical coordinates of the upper-left
corner of the dialog box (in global coordinates).
quality the desired quality of the recorded sound. Currently, three values
are recognized for the quality parameter: 'good', 'betr', and 'best'. The
precise meanings of these parameters are dependent on the sound
input driver. For Apple-supplied drivers, this parameter
determines whether the recorded sound is to be compressed, and if so,
whether at a 6:1 or a 3:1 ratio. A quality of 'best' does not compress
the sound and provides the best quality output, but at the expense of
memory. The quality 'betr' is suitable for most nonvoice recording,
and 'good' is suitable for voice recording.
sndHandle is a handle to some storage space. You must pass in either a valid
handle or NULL. If sndHandle is NULL, the Sound Manager allocates the largest amount of space in the application's heap that it can and
then resizes the handle when the user clicks the Save button in the
sound input dialog box. If the sndHandle parameter passed to
SndRecord is not NULL, the recording time is derived from the amount of memory reserved by the handle.
noErr (0) No error
userCanceledErr (-128) User canceled the ope ration
siBadSoundInDevice (-221) Invalid sound input device
siUnknownQuality (-232) Unknown quality
Notes: SndRecord displays a sound input dialog box and is always called synchronously. Controls in the dialog box allow the user to start, stop,
pause, and resume sound recording, as well as to play back the recorded
sound. The dialog box also lists the amount of time remaining to record and
the current microphone sound level.