Continuous Play From Disk
Continuous Play From Disk "Tape player" cap ability
The enhanced Sound Manager provides the ability to play a sampled sound
continuously from disk while other tasks execute. You might think of the
play-from-disk routines as providing you with the ability to install a
"tape player" in a sound channel. Once the sound begins to play, it continues
un interrupted unless an application pauses or stops it.
A new function, SndStartFilePlay, allows you to play sounds stored in AIFF
format or AIFF-C format, as well as 'snd ' resources, continuously from disk.
SndStartFilePlay works like SndPlay but does not require that the entire
sound be in RAM at one time. Hence, SndStartFilePlay is ideal for playing
very large sounds. The continuous play-from-disk routines use a buffer area
that is smaller than the sampled sound, and they update the buffer from disk
by using a double- buffering scheme. This technique minimizes RAM usage at
the expense of additional disk overhead. The disk overhead is relatively light,
however, and most mass-storage devices currently available for Macintosh
computers have response times good enough that SndStartFilePlay can
retrieve audio data from disk and play the sound without gaps.
There are no limits on the number of concurrent disk-based sampled sound
playbacks other than those imposed by processor speed. On machines with
sufficient CPU resources, several continuous playbacks may occur at once.
Disk fragmentation can also affect the performance of playing sampled sound
files from disk. It is recommended that no more than one file per hard disk be
played at any time.
When multiple disk-based sampled sounds are playing, the
Sound Manager automatically mixes the playbacks for output on the
available sound hardware. Note, however, that the Sound Manager supports
continuous play from disk only on machines equipped with an Apple Sound
Chip. Also, if a sound channel is being used for continuous play from disk, then
no other sound commands can be sent to that channel.