Previous Book Contents Book Index Next

Inside Macintosh: Sound /
Chapter 2 - Sound Manager / Sound Manager Reference
Data Structures


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.

Audio Selection Records

You can pass a pointer to an audio selection record to the SndStartFilePlay function to play only part of a sound in a file on disk. The AudioSelection data type defines an audio selection record.

TYPE AudioSelection =
PACKED RECORD
   unitType:   LongInt;    {type of time unit}
   selStart:   Fixed;      {starting point of selection}
   selEnd:     Fixed;      {ending point of selection}
END;
Field Description
unitType
The type of unit of time used in the selStart and selEnd fields. You can set this to seconds by specifying the constant unitTypeSeconds.
selStart
The starting point in seconds of the sound to play. If selStart is greater than selEnd, SndStartFilePlay returns an error.
selEnd
The ending point in seconds of the sound to play.
Use a constant to specify the unit type.

CONST
   unitTypeSeconds         = $0000;    {seconds}
   unitTypeNoSelection     = $FFFF;    {no selection}
If the value in the unitType field is unitTypeNoSelection, then the values in the selStart and selEnd fields are ignored and the entire sound plays. Alternatively, if you wish to play an entire sound, you can pass NIL instead of a pointer to an audio selection record to the SndStartFilePlay function.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996