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 use the following constants to specify initialization parameters for a sound channel. You need to specify initialization parameters when you call SndNewChannel .
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}
Play sounds through the left channel of the Macintosh audio jack.
Play sounds through the right channel of the Macintosh audio jack.
Play sounds through the first wave-table channel.
Play sounds through the second wave-table channel.
Play sounds through the third wave-table channel.
Play sounds through the fourth wave-table channel.
Play the same sound through both channels of the Macintosh audio jack and the internal speaker. This is the default channel mode.
Play stereo sounds through both channels of the Macintosh audio jack and the internal speaker. Note that some machines cannot play stereo sounds.
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.
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.
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.
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.
The Sound Manager also recognizes the following masks, which you can use to select various channel attributes:
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}
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.