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 theSndStartFilePlay
function to play only part of a sound in a file on disk. TheAudioSelection
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;Use a constant to specify the unit type.
Field Description
unitType
- The type of unit of time used in the
selStart
andselEnd
fields. You can set this to seconds by specifying the constantunitTypeSeconds
.selStart
- The starting point in seconds of the sound to play. If
selStart
is greater thanselEnd
,SndStartFilePlay
returns an error.selEnd
- The ending point in seconds of the sound to play.
CONST unitTypeSeconds = $0000; {seconds} unitTypeNoSelection = $FFFF; {no selection}If the value in theunitType
field isunitTypeNoSelection
, then the values in theselStart
andselEnd
fields are ignored and the entire sound plays. Alternatively, if you wish to play an entire sound, you can passNIL
instead of a pointer to an audio selection record to theSndStartFilePlay
function.