Inside Macintosh: Sound Manager
| Previous | Chapter contents | Chapter top | Section top | Next |
Important: Sound Input Manager 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 input device drivers must call the SPBSignInDevice function to register with the Sound Input Manager before they can use its sound input services. You might call this routine at system startup time from within an extension to install a sound input device driver. Your application can generate a list of registered sound input devices by using the SPBGetIndexedDevice function. You can cancel the registration of your driver, thus removing it from the Sound control panel and making it inaccessible, by calling the SPBSignOutDevice function.
You can register a sound input device by calling the SPBSignInDevice function.
FUNCTION SPBSignInDevice (deviceRefNum: Integer;
deviceName: Str255): OSErr;
The device driver reference number of the sound input device to register with the Sound Input Manager.
The device's name as it is to appear to the user in the Sound In control panel (which is not the name of the driver used by the Device Manager).
The SPBSignInDevice function registers with the Sound Input Manager the device whose driver reference number is deviceRefNum .
The deviceName parameter specifies this device's name as it is to appear to the user in the Sound In control panel (which is not the name of the driver itself). Accordingly, the name should be as descriptive as possible. You should call SPBSignInDevice after you have already opened your driver by calling normal Device Manager routines.
Because the SPBSignInDevice function moves or purges memory, you should not call it at interrupt time. You can, however, call it at system startup time.
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;
The index number of the sound input device you wish to obtain information about.
On exit, the name of the sound input device specified by the count parameter.
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.
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.
Because the SPBGetIndexedDevice function allocates memory, you should not call it at interrupt time.
You can use the SPBSignOutDevice function to cancel the registration of a device you have previously registered with the SPBSignInDevice function.
FUNCTION SPBSignOutDevice (deviceRefNum: Integer): OSErr;
The driver reference number of the device you wish to sign out.
The SPBSignOutDevice function cancels the registration of the device whose driver reference number is deviceRefNum ; the device is unregistered from the Sound Input Manager's list of available sound input devices and no longer appears in the Sound In control panel.
Ordinarily, you should not need to use the SPBSignOutDevice function. You might use it if your device driver detects that a sound input device is not functioning correctly or has been disconnected.
Because the SPBSignOutDevice function moves or purges memory, you should not call it at interrupt time.
Inside Macintosh: Sound Manager
| Previous | Chapter contents | Chapter top | Section top | Next |
Important: Sound Input Manager 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.