Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!samsung!munnari.oz.au!uhccux!waikato.ac.nz!ldo From: ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) Newsgroups: comp.sys.mac.programmer Subject: Undocumented sound input calls Message-ID: <1991Jan24.100250.2799@waikato.ac.nz> Date: 23 Jan 91 21:02:50 GMT Organization: University of Waikato, Hamilton, New Zealand Lines: 45 I was watching the "Sound" control panel with MacsBug the other evening, trying to figure out how it could get and set the default sound input device. I found a couple of new Sound Input Manager calls that it uses. Here are the interfaces for them, in Metrowerks Modula-2 (hopefully that should be equally annoying to both Pascal and C users...). The names of the routines are, of course, my own. The "get default device" call is the really useful one; you shouldn't go about changing the default device without the user's permission. CONST siToolNum = 20; (* tool number of Sound Input Manager *) siGetDefaultDevice = (2 * 256) + 80; siSetDefaultDevice = (2 * 256) + 84; PROCEDURE SPBGetDefaultDevice ( VAR deviceName : Str255 ) : OSErr; (* gets the name of the default sound input device from the in-memory setting. *) CODE 0203CH, siGetDefaultDevice, siToolNum, (* move.l #$02500014, d0 *) 0A800H; (* _SndDispatch *) PROCEDURE SPBSetDefaultDevice ( VAR deviceName : Str255 ) : OSErr; (* sets a new default input device. Note that this only changes the in-memory setting (which is lost when the machine shuts down); for a more permanent change, also save the name of the new default device in the STRing resource with ID -16456 in the System file. *) CODE 0203CH, siSetDefaultDevice, siToolNum, (* move.l #$02540014, d0 *) 0A800H; (* _SndDispatch *) Lawrence D'Oliveiro fone: +64-71-562-889 Computer Services Dept fax: +64-71-384-066 University of Waikato electric mail: ldo@waikato.ac.nz Hamilton, New Zealand 37^ 47' 26" S, 175^ 19' 7" E, GMT+13:00