Previous Book Contents Book Index Next

Inside Macintosh: Sound /
Chapter 3 - Sound Input Manager / Sound Input Manager Reference
Sound Input Manager Routines / Recording Sounds


Legacy Documentclose button

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.

SndRecordToFile

You can use SndRecordToFile to record sound data into a file.

FUNCTION SndRecordToFile (filterProc: ProcPtr; corner: Point; 
                           quality: OSType; 
                           fRefNum: Integer): OSErr;
filterProc
A pointer to a function that determines how user actions in the sound recording dialog box are filtered.
corner
The horizontal and vertical coordinates of the upper-left corner of the sound recording dialog box (in global coordinates).
quality
The desired quality of the recorded sound, as described on page 3-28.
fRefNum
The file reference number of an open file to save the audio data in.
DESCRIPTION
The SndRecordToFile function works just like SndRecord except that it stores the sound input data into a file. The resulting file is in either AIFF or AIFF-C format and contains the information necessary to play the file by using the Sound Manager's SndStartFilePlay function. The SndRecordToFile function is always called synchronously.

Your application must open the file specified in the fRefNum parameter before calling the SndRecordToFile function. Your application must close the file sometime after calling SndRecordToFile.

SPECIAL CONSIDERATIONS
Because the SndRecordToFile function moves memory, you should not call it at interrupt time.

ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for the SndRecordToFile function are
Trap macroSelector
_SoundDispatch$07080014

RESULT CODES
noErr0No error
userCanceledErr-128User canceled the operation
siBadSoundInDevice-221Invalid sound input device
siUnknownQuality-232Unknown quality

Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996