home *** CD-ROM | disk | FTP | other *** search
/ IRIS Development Option 6.2 / IRIS_Development_Option_6.2_814-0478-001.iso / dist / dmedia_dev.idb / usr / include / dmedia / dm_audio.h.z / dm_audio.h
C/C++ Source or Header  |  1996-03-14  |  5KB  |  186 lines

  1. #ifndef __INC_DM_AUDIO_H__
  2. #define __INC_DM_AUDIO_H__  
  3.  
  4. /*****************************************************************************
  5. *
  6. *  Copyright 1993, Silicon Graphics, Inc.
  7. *  All Rights Reserved.
  8. *
  9. *  This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  10. *  the contents of this file may not be disclosed to third parties, copied or
  11. *  duplicated in any form, in whole or in part, without the prior written
  12. *  permission of Silicon Graphics, Inc.
  13. *
  14. *  RESTRICTED RIGHTS LEGEND:
  15. *  Use, duplication or disclosure by the Government is subject to restrictions
  16. *  as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  17. *  and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  18. *  successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  19. *  rights reserved under the Copyright Laws of the United States.
  20. *****************************************************************************/
  21.  
  22. #include <stdlib.h>        /* for size_t */
  23. #include <dmedia/dm_params.h>
  24.  
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif
  28.  
  29. /**********************************************************************
  30. *
  31. * Audio Parameters
  32. * ----------------
  33. *
  34. * The following set of parameters defines how audio data is represented:
  35. *
  36. *   o  sample rate
  37. *   o  number of channels
  38. *   o  compression (or "coding") scheme
  39. *
  40. * If the data is not compressed (ie, if the "coding scheme" is "linear PCM"),
  41. * an additional parameter describes the numerical format of the samples:
  42. *
  43. *   o  sample format (two's complement, unsigned integer, float, double)
  44. *
  45. * If the numerical format for the linear PCM data is two's 
  46. * complement or unsigned integer, 
  47. * an additional parameter describes the number of bits of resolution:
  48. *
  49. *   o  sample width (number of meaningful bits per sample)
  50. *
  51. * Library Compatibility
  52. * ---------------------
  53. *
  54. *    Each of the digital media libraries supports a different set of
  55. *    audio formats.  There are comments to the right of each constant
  56. *    indicating which of the libraries support it:
  57. *
  58. *            MV = Movie Library
  59. *            AF = Audio File Library
  60. *            CL = Compression Library
  61. *
  62. **********************************************************************/
  63.  
  64.  
  65. /********
  66. *
  67. * Sample Data Format:
  68. *    Data format used to represent linear PCM samples.
  69. *
  70. ********/
  71.  
  72. #define DM_AUDIO_FORMAT        "DM_AUDIO_FORMAT"
  73.     
  74. /********
  75. *
  76. * Note that _DMaudioformat values are used by <dmedia/audiofile.h>
  77. * for its AF_SAMPFMT_* values.
  78. *
  79. ********/
  80.  
  81. typedef enum __DMaudioformat
  82. {
  83.     DM_AUDIO_TWOS_COMPLEMENT = 401,            /* MV, AF */
  84.     DM_AUDIO_UNSIGNED        = 402,            /* MV, AF */
  85.     DM_AUDIO_FLOAT           = 403,                     /*     AF */
  86.     DM_AUDIO_DOUBLE          = 404                      /*     AF */
  87. } DMaudioformat;
  88.  
  89. /********
  90. *
  91. * Sample Resolution in Bits: 
  92. *    Relevant for integer linear PCM data formats (two's complement, signed).
  93. *
  94. ********/
  95.  
  96. #define DM_AUDIO_WIDTH        "DM_AUDIO_WIDTH"
  97.  
  98. #define DM_AUDIO_WIDTH_8     8            /* MV */
  99. #define DM_AUDIO_WIDTH_16     16            /* MV */
  100. #define DM_AUDIO_WIDTH_24     24
  101.  
  102.  
  103. /********
  104. *
  105. * Sampling Rate:      
  106. *    Stored as a double.
  107. *
  108. ********/
  109.  
  110. #define DM_AUDIO_RATE        "DM_AUDIO_RATE"
  111.  
  112. /********
  113. *
  114. * Number of Channels:    
  115. *    Stored as an integer.
  116. *
  117. ********/
  118.  
  119. #define DM_AUDIO_CHANNELS    "DM_AUDIO_CHANNELS"
  120.  
  121. /********
  122. *
  123. * Audio Compression Schemes. Uncompressed audio refers to linear PCM data.
  124. *
  125. ********/
  126.  
  127. #define DM_AUDIO_COMPRESSION    "DM_AUDIO_COMPRESSION"
  128.  
  129. #define DM_AUDIO_UNCOMPRESSED    "Uncompressed Audio"    /* MV, CL */
  130. #define DM_AUDIO_G711_ULAW    "G.711 u-law"           /* CL */
  131. #define DM_AUDIO_G711_ALAW    "G.711 A-law"           /* CL */
  132. #define DM_AUDIO_MPEG1        "MPEG-1 Audio"          /* CL */
  133. #define DM_AUDIO_MPEG        DM_AUDIO_MPEG1
  134. #define DM_AUDIO_MULTIRATE    "Aware MultiRate"       /* CL */
  135. #define DM_AUDIO_G722        "G.722"
  136. /*
  137.  * SGI does not provide encode/decode support for the following schemes
  138.  */
  139. #define DM_AUDIO_APPLE_ACE2    "Apple ACE2"
  140. #define DM_AUDIO_APPLE_ACE8     "Apple ACE8"
  141. #define DM_AUDIO_APPLE_MAC3     "Apple MAC3"
  142. #define DM_AUDIO_APPLE_MAC6     "Apple MAC6"
  143.  
  144. /*******
  145. *
  146. * Bitrate
  147. *
  148. ********/
  149.  
  150. #define DM_AUDIO_BITRATE  "DM_AUDIO_BITRATE"
  151.  
  152. /**********************************************************************
  153. *
  154. * Audio Functions
  155. *
  156. **********************************************************************/
  157.  
  158. /********
  159. *
  160. * dmSetAudioDefaults
  161. *
  162. ********/
  163.  
  164. extern DMstatus dmSetAudioDefaults( DMparams*  toParams,
  165.                     int        audioWidth,
  166.                     double     audioSamplingRate,
  167.                     int        audioChannels );
  168.  
  169. /********
  170. *
  171. * dmAudioFrameSize
  172. *
  173. * Returns the number of bytes required to store an audio frame.
  174. * (One sample for all channels).
  175. *
  176. ********/
  177.  
  178. size_t dmAudioFrameSize( const DMparams* params );
  179.  
  180. #ifdef __cplusplus 
  181. }
  182. #endif
  183.  
  184. #endif /* ! __INC_DM_AUDIO_H__  */
  185.