Inside Macintosh: Sound
| Previous | Chapter contents | Chapter top | Section top | Next |
Important: Sound Input Manager 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.
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;
The type of unit of time used in the selStart and selEnd fields. You can set this to seconds by specifying the constant unitTypeSeconds .
The starting point in seconds of the sound to play. If selStart is greater than selEnd , SndStartFilePlay returns an error.
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.
Inside Macintosh: Sound
| Previous | Chapter contents | Chapter top | Section top | Next |
Important: Sound Input Manager 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.