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.
SPBGetDeviceInfo
You can use theSPBGetDeviceInfofunction to get information about the settings of a sound input device.
FUNCTION SPBGetDeviceInfo (inRefNum: LongInt; infoType: OSType; infoData: Ptr): OSErr;
inRefNum- The device reference number of the sound input device, as obtained from the
SPBOpenDevicefunction.infoType- A sound input device information selector that specifies the type of information you need.
infoData- A pointer to a buffer in which information should be returned. This buffer must be large enough for the type of information specified in the
infoTypeparameter.DESCRIPTION
TheSPBGetDeviceInfofunction returns information about the sound input device specified by theinRefNumparameter. The type of information you want is specified in theinfoTypeparameter. The available sound input device information selectors are listed in "Sound Input Device Information Selectors" beginning on page 3-18. The information is copied into the buffer specified by theinfoDataparameter.SPECIAL CONSIDERATIONS
Because theSPBGetDeviceInfofunction might move memory, you should not call it at interrupt time. Check the selector description of the selector you want to use to see if it moves memory before calling theSPBGetDeviceInfofunction. Most of the selectors do not move memory and are therefore safe to use at interrupt time.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for theSPBGetDeviceInfofunction are
Trap macro Selector _SoundDispatch $06380014 RESULT CODES
noErr 0 No error siBadSoundInDevice -221 Invalid sound input device siUnknownInfoType -231 Unknown type of information SEE ALSO
Listing 3-2 on page 3-12 shows an example that uses theSPBGetDeviceInfofunction to get the name of a sound input device driver.