Previous Book Contents Book Index Next

Inside Macintosh: Sound /
Chapter 2 - Sound Manager / Sound Manager Reference
Resources


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.

The Sound Resource

You can store sound commands and sound data as a resource with the resource type 'snd '. Resource IDs from 0 to 8191 are reserved by Apple Computer, Inc. You may use all other resource IDs for your 'snd ' resources.

You can use the GetResource function to search all open resource files for the first 'snd ' resource type with the given ID. The 'snd ' resource type defines a sound resource. Figure 2-8 shows the structure of a sound resource.

Figure 2-8 The 'snd ' resource type

Often, you can create a sound resource simply by using the SndRecord function, documented in the chapter "Introduction to Sound on the Macintosh" in this book. However, you can also define a sound resource manually. This is especially useful for sound resources that are simply series of sound commands and contain no sampled-sound data. Also, you might construct a sound resource that contains wave-table data manually. A sound resource contains the following elements:

The format of the sound resource header differs depending on whether the 'snd ' resource is format 1 or format 2. Figure 2-9 illustrates the formats of the two types of sound resource header. Both sound headers begin with a format field, which defines the format of the sound resource as either $0001 or $0002.

Figure 2-9 The sound resource header


Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996