Previous Book Contents Book Index Next

Inside Macintosh: Sound /
Chapter 2 - Sound Manager / Sound Manager Reference
Sound Manager Routines / Obtaining Information


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.

SndControl

You can obtain information about a sound data type by using the SndControl function. In Sound Manager version 3.0 and later, however, you virtually never need to call SndControl. The capabilities that SndControl provides are either provided by the Gestalt function or are no longer supported. The SndControl function is documented here for completeness only.

FUNCTION SndControl (id: Integer; VAR cmd: SndCommand): OSErr;
id
The sound data type you want to get information about.
cmd
A sound command.
DESCRIPTION
The SndControl function sends a control command directly to the Sound Manager to get information about a specific data type. The available data types are specified by constants:

CONST
   squareWaveSynth   = 1;     {square-wave data}
   waveTableSynth    = 3;     {wave-table data}
   sampledSynth      = 5;     {sampled-sound data}
You can call SndControl even if no channel has been created for the type of data you want to get information about. SndControl can be used with the availableCmd or versionCmd sound commands to request information. The requested information is returned in the sound command record specified by the cmd parameter.

IMPORTANT
The SndControl function can indicate only whether a particular data format supports some feature (for example, stereo output), not whether the available sound hardware also supports that feature. In general, you should use the Gestalt function to determine whether the sound features you need are available in the current operating environment.
In Sound Manager version 2.0, you can also use the totalLoadCmd and loadCmd commands to get information about the amount of CPU time consumed by sound-related processing. However, these commands are not very accurate and are not supported by version 3.0 and later.

SPECIAL CONSIDERATIONS
You should not call the SndControl function at interrupt time.

RESULT CODES
noErr0No error
SEE ALSO
See the list of sound commands in "Sound Command Numbers" beginning on page 2-92 for a complete description of the sound commands supported by SndControl.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996