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.
Channel Initialization Parameters
You can use the following constants to specify initialization parameters for a sound channel. You need to specify initialization parameters when you callSndNewChannel
.
CONST initChanLeft = $0002; {left stereo channel} initChanRight = $0003; {right stereo channel} waveInitChannel0 = $0004; {wave-table channel 0} waveInitChannel1 = $0005; {wave-table channel 1} waveInitChanne12 = $0006; {wave-table channel 2} waveInitChannel3 = $0007; {wave-table channel 3} initMono = $0080; {monophonic channel} initStereo = $00C0; {stereo channel} initMACE3 = $0300; {3:1 compression} initMACE6 = $0400; {6:1 compression} initNoInterp = $0004; {no linear interpolation} initNoDrop = $0008; {no drop-sample conversion}Constant descriptions
The Sound Manager also recognizes the following masks, which you can use to select various channel attributes:
initChanLeft
- Play sounds through the left channel of the Macintosh audio jack.
initChanRight
- Play sounds through the right channel of the Macintosh audio jack.
- waveInitChannel0
- Play sounds through the first wave-table channel.
- waveInitChannel1
- Play sounds through the second wave-table channel.
- waveInitChannel2
- Play sounds through the third wave-table channel.
- waveInitChannel3
- Play sounds through the fourth wave-table channel.
initMono
- Play the same sound through both channels of the Macintosh audio jack and the internal speaker. This is the default channel mode.
initStereo
- Play stereo sounds through both channels of the Macintosh audio jack and the internal speaker. Note that some machines cannot play stereo sounds.
initMACE3
- Assume that the sounds to be played through the channel are MACE 3:1 compressed. The
SndNewChannel
function uses this information to help determine whether it can allocate a new sound channel. A noncompressed sound plays normally, even through a channel that has been initialized for MACE.initMACE6
- Assume that the sounds to be played through the channel are MACE 6:1 compressed. The
SndNewChannel
function uses this information to help determine whether it can allocate a new sound channel. A noncompressed sound plays normally, even through a channel that has been initialized for MACE.
initNoInterp
- Do not use linear interpolation to smooth a sound played back at a different sample rate from the sound's recorded sample rate. Using the
initNoInterp
initialization parameter decreases the CPU load for this channel. Sounds most affected by the absence of linear interpolation are sinusoidal sounds. Sounds least affected are noisy sound effects like explosions and screams.initNoDrop
- Do not use drop-sample conversion to fake sample rate conversion. Using the
initNoDrop
initialization parameter increases the CPU load for the channel but results in a smoother sound.
CONST initPanMask = $0003; {mask for right/left pan values} initSRateMask = $0030; {mask for sample rate values} initStereoMask = $00C0; {mask for mono/stereo values} initCompMask = $FF00; {mask for compression IDs}