Important: Inside Macintosh: Sound is deprecated as of Mac OS X v10.5. For new audio development in Mac OS X, use Core Audio. See the Audio page in the ADC Reference Library.
Sound Recording Without the Standard Interface
The Sound Input Manager provides your application with the ability to record and digitally store sounds in a device-independent manner even if your application does not use the standard sound recording interface. In cases where you need very fine control over the recording process, you can call various low-level sound input routines.Your application can obtain control over sound recording in two different ways. First, if your application uses the sound recording dialog box, you can modify the dialog box's features by defining a custom filter procedure, as explained in detail in the chapter "Dialog Manager" in Inside Macintosh: Macintosh Toolbox Essentials. Second, if your application needs to fine tune the sound recording process itself (or if your application does not use the standard sound recording dialog box), then the application must use the Sound Input Manager's low-level routines.
In instances where you need to gain greater control over the recording process, you can use a set of routines that manipulate the incoming sound data by using sound parameter blocks. The parameter blocks contain information about the current recording device, the length recorded, a routine to call on completion of the recording, and so forth. You can call the
SPBRecord
function (or theSPBRecordToFile
function) to begin a recording. Then you can use the functionsSPBPauseRecording
,SPBResumeRecording
, andSPBStopRecording
to control the recording. Note that you need to open a device (using theSPBOpenDevice
function) before you can record from it. On completion of the recording, you should close the device (using theSPBCloseDevice
function).If you do record sounds using the Sound Input Manager's low-level routines, you also need to set up your own sound resource headers or sound files, because the Sound Input Manager's low-level routines return raw sampled-sound data to your application. The Sound Input Manager provides two functions,
SetupSndHeader
andSetupAIFFHeader
, that allow you to set up your own sound resource headers or sound files.