Previous Book Contents Book Index Next

Inside Macintosh: Sound /
Chapter 3 - Sound Input Manager / Sound Input Manager Reference
Sound Input Manager Routines / Registering Sound Input Devices


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.

SPBGetIndexedDevice

You can use the SPBGetIndexedDevice function to help generate a list of sound input devices.

FUNCTION SPBGetIndexedDevice (count: Integer; 
                                 VAR deviceName: Str255;
                                 VAR deviceIconHandle: Handle):
                                 OSErr;
count
The index number of the sound input device you wish to obtain information about.
deviceName
On exit, the name of the sound input device specified by the count parameter.
deviceIconHandle
On exit, a handle to the icon of the sound input device specified by the count parameter. The memory for this icon is allocated automatically, but your application must dispose of it.
DESCRIPTION
The SPBGetIndexedDevice function returns the name and icon of the device whose index is specified in the count parameter. Your application can create a list of sound input devices by calling this function with a count starting at 1 and incrementing it by 1 until the function returns siBadSoundInDevice.

Because the Sound In control panel allows the user to select a sound input device, most applications should not use this function. Your application might need to use this function if it allows the user to record from more than one sound input device at once.

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

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

RESULT CODES
noErr0No error
siBadSoundInDevice-221Invalid sound input device

Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996