Previous Book Contents Book Index Next

Inside Macintosh: Sound /
Chapter 2 - Sound Manager / Sound Manager Reference
Data Structures


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.

Sound Double Buffer Records

You must fill in a sound double buffer header record if you wish to manage your own double buffers. The dbhBufferPtr field of the sound double buffer header record references two sound double buffer records, which you must also fill out. The SndDoubleBufferHeader data type defines a sound double buffer header.

TYPE SndDoubleBuffer =
PACKED RECORD
   dbNumFrames:   LongInt;                      {number of frames in buffer}
   dbFlags:       LongInt;                      {buffer status flags}
   dbUserInfo:    ARRAY[0..1] OF LongInt;       {for application's use}
   dbSoundData:   PACKED ARRAY[0..0] OF Byte;   {array of data}
END;
Field Description
dbNumFrames
The number of frames in the dbSoundData array.
dbFlags
Buffer status flags.
dbUserInfo
Two long words into which you can place information that you need to access in your doubleback procedure.
dbSoundData
A variable-length array. You write samples into this array, and the Sound Manager reads samples out of this array.
The buffer status flags field for each of the two buffers can contain either of these values that your doubleback procedure must set when appropriate:

CONST
   dbBufferReady     = $00000001;
   dbLastBuffer      = $00000004;
All other bits in the dbFlags field are reserved by Apple; your application should not modify them.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996