Installing Voices Into Channels
You can play frequencies through any of the three available playback
synthesizers. By playing a frequency through the wave-table synthesizer or
sampled sound synthesizer, you can achieve a different sound than by playing
that same frequency through the square-wave synthesizer. To do that,
however, you need to install a voice into the sound channel to which you want to
send freqDurationCmd commands. You can install a wave table into a channel as a voice by issuing the
waveTableCmd command. The param1 field of the sound command specifies the
length of the wave table and the param2 field is a pointer to the wave- table
data itself. Note that the Sound Manager will resample the wave table so that it is exactly 512 bytes long.
You can install a sampled sound into a channel as a voice by issuing the
soundCmd command. You can either issue this command from your application
or put it into an 'snd ' resource. If your application sends this command,
param2 is a pointer to the sampled sound locked in memory. If soundCmd is
contained within an 'snd ' resource, the high bit of the command must be set. To
use a sampled sound 'snd ' as a voice, first obtain a pointer to the sampled sound
header locked in memory. Then pass this pointer in param2 of a soundCmd
command. After using the sound, your application is expected to unlock this
resource and allow it to be purged.