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.

GetSoundHeaderOffset

You can use the GetSoundHeaderOffset function to get the offset from the beginning of a sound resource to the embedded sound header.

FUNCTION GetSoundHeaderOffset (sndHdl: Handle; 
                                 VAR offset: LongInt): OSErr;
sndHdl
A handle to a sound resource.
offset
On exit, the offset from the beginning of the sound resource specified by the sndHdl parameter to the beginning of the sound header within that sound resource.
DESCRIPTION
The GetSoundHeaderOffset function returns, in the offset parameter, the number of bytes from the beginning of the sound resource specified by the sndHdl parameter to the sound header that is contained within that resource. You might need this information if you want to use the address of that sound header in a sound command (such as the soundCmd or bufferCmd sound command).

The handle passed to GetSoundHeaderOffset does not have to be locked.

SPECIAL CONSIDERATIONS
The GetSoundHeaderOffset function is available only in version 3.0 and later of the Sound Manager. See "Obtaining a Pointer to a Sound Header" beginning on page 2-57 for a function you can call in earlier versions of the Sound Manager to obtain the same information.

You can call the GetSoundHeaderOffset function at interrupt time.

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

RESULT CODES
noErr0No error
badFormat-206Resource is corrupt or unusable
SEE ALSO
See Listing 2-27 on page 2-57 for an example of calling GetSoundHeaderOffset.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996