Previous Book Contents Book Index Next

Inside Macintosh: Sound /
Chapter 2 - Sound Manager / Sound Manager Reference
Sound Manager Routines / Managing Double Buffers


Legacy Documentclose button

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.

SndPlayDoubleBuffer

The SndPlayDoubleBuffer function is a low-level routine that gives you maximum efficiency and control over double buffering while still maintaining compatibility with the Sound Manager.

FUNCTION SndPlayDoubleBuffer (chan: SndChannelPtr;
                     theParams: SndDoubleBufferHeaderPtr): OSErr;
chan
A pointer to a valid sound channel.
theParams
A pointer to a sound double buffer header record.
DESCRIPTION
The SndPlayDoubleBuffer function launches a low-level sound play using the information in the double buffer header record specified by theParams. After your application calls this function, the Sound Manager repeatedly calls the doubleback procedure you specify in the double buffer header record. The doubleback procedure then manages the filling of buffers of sound data from disk whenever one of the two buffers specified in the double buffer header record becomes exhausted.

SPECIAL CONSIDERATIONS
Because the SndPlayDoubleBuffer function might move memory, you should not call it at interrupt time.

You can use the SndPlayDoubleBuffer function only on a Macintosh computer that supports the play-from-disk routines. For information on how to determine whether a computer supports these routines, see "Testing for Multichannel Sound and Play-From-Disk Capabilities" on page 2-35.

ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for the SndPlayDoubleBuffer function are
Trap macroSelector
_SoundDispatch$00200008

RESULT CODES
noErr0No error
badChannel-205Channel is corrupt or unusable
SEE ALSO
For information on the format of a doubleback procedure, see "Doubleback Procedures" on page 2-153.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996