Introduction to Sound
Introduction to Sound Basic topics
Sound is created on a Macintosh computer when the Sound Manager (or an
application) sends data to whatever audio hardware is available on the
machine. The audio hardware is a digital-to-analog converter (DAC) that
translates digital audio data into analog audio signals; those signals are then
sent to the internal speaker or to a sound output connector (to which the user
can connect headphones, external speakers, or sound amplification equipment).
The DAC in all current Macintosh computers as of this date is a Sony sound
chip. The Macintosh II family of computers and more recent models (such as
the Macintosh SE/30 and Macintosh Por table) contain two Sony sound chips
(to provide stereo output cap ability) as well as an Apple Sound Chip, a
customized chip that provides enhanced audio output characteristics as well as
emulation capabilities for the earlier sound hardware. There are also NuBus
expansion boards available from third-party developers that provide other
audio DAC hardware.
To maximize compatibility across the entire family of Macintosh computers,
your application should never address any built-in audio hardware directly.
Instead, you should always create sound by sending the appropriate
in structions to the Sound Manager. The Sound Manager is responsible for
managing all communication between your application and the available audio
hardware, as illustrated in theFigure below.
Your application creates sound by sending sound commands to the
Sound Manager, which interprets those commands and places them into a
sound channel. A sound channel is a first-in, first-out (FIFO) queue. Queued
commands are sent to the sound hardware through a sound synthesizer,
which is like a device driver insofar as it is responsible for managing the last
stage of communication with the audio hardware. Every sound channel is linked
to one of three available synthesizers, depending on the type of sound to be
produced.
The position of the Sound Manager
Sometimes it is necessary to bypass the queue of sound commands altogether.
If you want to stop all sound production on a particular channel immediately,
for example, it would be counterproductive to send a command to the sound
channel because that command remains queued until it becomes the next
command processed by the synthesizer. Instead, you can send commands
directly to the synthesizer, as illustrated in the Figure below.
Bypassing the command queue
When you bypass the sound channel in this way, any commands that are
already queued but not yet sent to the synthesizer remain queued. You can,
however, flush the channel at any time by sending the Sound Manager the
appropriate command.
With the enhanced Sound Manager, you can have multiple channels of
sampled sound open and multiple commands sent to the sampled sound
synthesizer con currently. For example, two different applications can each
open a sound channel and send commands to it. The Figure below illustrates
such a situation.
Mixing multiple channels of sampled sound
In this illust ration, two applications are sending sound commands to the
sampled sound synthesizer. The Sound Manager maintains a separate queue
of commands for each application but mixes the audio data before sending it to
the sampled sound synthesizer. The result is a single audio signal that is sent
to the available audio hardware.