home *** CD-ROM | disk | FTP | other *** search
/ Education Sampler 1992 [NeXTSTEP] / Education_1992_Sampler.iso / SoundAndMusic / cmix / H / soundstruct.h < prev    next >
Text File  |  1991-12-17  |  3KB  |  70 lines

  1. /*
  2.  *    soundstruct.h
  3.  *    Copyright 1988-89 NeXT, Inc.
  4.  *
  5.  * SNDSoundStruct - This data format for sound is used as the soundfile
  6.  * format, and also the "NeXT sound pasteboard type". It consists of a header
  7.  * and two variable length quantities: textual information (the info string)
  8.  * and raw data. The raw data starts past the info; the dataLocation is
  9.  * normally used to specify an offset from the beginning of the SNDSoundStruct
  10.  * structure to this data. The dataSize is the length of the raw data in bytes. 
  11.  * The dataFormat, samplingRate, and channelCount further describe the data.
  12.  * The data itself may be anything; the format determines what the data
  13.  * actually means (i.e. sample data, dsp core structure).
  14.  * The magic number value may be used to determine the byte order of the data.
  15.  * The info string is any null-terminated data that the application may need
  16.  * (i.e. copyright information, textual description). The four bytes allocated
  17.  * are a minimum; the info string may extend any length beyond the structure.
  18.  */
  19. typedef struct {
  20.     int magic;        /* must be equal to SND_MAGIC */
  21.     int dataLocation;    /* Offset or pointer to the raw data */
  22.     int dataSize;    /* Number of bytes of data in the raw data */
  23.     int dataFormat;    /* The data format code */
  24.     int samplingRate;    /* The sampling rate */
  25.     int channelCount;    /* The number of channels */
  26.     char info[4];    /* Textual information relating to the sound. */
  27. } SNDSoundStruct;
  28.  
  29.  
  30. /*
  31.  * The magic number must appear at the beginning of every SNDSoundStruct.
  32.  * It is used for type checking and byte ordering information.
  33.  */
  34. #define SND_MAGIC ((int)0x2e736e64)
  35.  
  36. /*
  37.  * NeXT data format codes. User-defined formats should be greater than 255.
  38.  * Negative format numbers are reserved.
  39.  */
  40. #define SND_FORMAT_UNSPECIFIED        (0)
  41. #define SND_FORMAT_MULAW_8        (1)
  42. #define SND_FORMAT_LINEAR_8        (2)
  43. #define SND_FORMAT_LINEAR_16        (3)
  44. #define SND_FORMAT_LINEAR_24        (4)
  45. #define SND_FORMAT_LINEAR_32        (5)
  46. #define SND_FORMAT_FLOAT        (6)
  47. #define SND_FORMAT_DOUBLE        (7)
  48. #define SND_FORMAT_INDIRECT        (8)
  49. #define SND_FORMAT_NESTED        (9)
  50. #define SND_FORMAT_DSP_CORE        (10)
  51. #define SND_FORMAT_DSP_DATA_8        (11)
  52. #define SND_FORMAT_DSP_DATA_16        (12)
  53. #define SND_FORMAT_DSP_DATA_24        (13)
  54. #define SND_FORMAT_DSP_DATA_32        (14)
  55. #define SND_FORMAT_DISPLAY        (16)
  56. #define SND_FORMAT_MULAW_SQUELCH    (17)
  57. #define    SND_FORMAT_EMPHASIZED        (18)
  58. #define    SND_FORMAT_COMPRESSED        (19)
  59. #define    SND_FORMAT_COMPRESSED_EMPHASIZED (20)
  60. #define    SND_FORMAT_DSP_COMMANDS        (21)
  61. #define    SND_FORMAT_DSP_COMMANDS_SAMPLES    (22)
  62.  
  63. /*
  64.  * Sampling rates directly supported in hardware.
  65.  */
  66. #define SND_RATE_CODEC        (8012.8210513)
  67. #define SND_RATE_LOW        (22050.0)
  68. #define SND_RATE_HIGH        (44100.0)
  69.  
  70.