wavepdd.h
上传用户:qiulin1960
上传日期:2013-10-16
资源大小:2844k
文件大小:4k
源码类别:

Windows CE

开发平台:

Windows_Unix

  1. #pragma once
  2. // -----------------------------------------------------------------------------
  3. //
  4. //      THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  5. //      ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  6. //      THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  7. //      PARTICULAR PURPOSE.
  8. //      Copyright (c) 1995-2000 Microsoft Corporation.  All rights reserved.
  9. //
  10. // -----------------------------------------------------------------------------
  11. //
  12. //  Module Name:
  13. //
  14. //      wavepdd.h
  15. //
  16. //  Abstract:
  17. //
  18. //  Functions:
  19. //
  20. //  Notes:
  21. //
  22. // -----------------------------------------------------------------------------
  23. // -----------------------------------------------------------------------------
  24. //
  25. // @doc     EX_AUDIO_DDSI
  26. //
  27. // @enum    PCM_TYPE | Enumeration of standard PCM data types.
  28. //
  29. // @field   PBYTE | pData | Pointer to just the data buffer which contains
  30. //          the waveform data to be played.
  31. //
  32. // @field   ULONG | nBufferSize |
  33. //          Size, in number of bytes, of the buffer to play.
  34. //
  35. // @field   ULONG | nBufferPosition |
  36. //          Current position, in number of bytes in the user buffer.
  37. //
  38. // @field   BOOL | fLooping |
  39. //          If TRUE, the buffer should be played in an infinite loop.
  40. //
  41. // -----------------------------------------------------------------------------
  42. typedef enum {
  43.      PCM_TYPE_M8,
  44.      PCM_TYPE_M16,
  45.      PCM_TYPE_S8,
  46.      PCM_TYPE_S16
  47. } PCM_TYPE, *PPCM_TYPE;
  48. // -----------------------------------------------------------------------------
  49. //
  50. // @doc     EX_AUDIO_DDSI
  51. //
  52. // @struct  SAMPLE_8_MONO | Single sample from 8-bit mono PCM data stream.
  53. //
  54. // @field   UINT8 | sample | Unsigned 8-bit sample
  55. //
  56. // -----------------------------------------------------------------------------
  57. typedef struct  {
  58.     UINT8 sample;              // Unsigned 8-bit sample
  59. } SAMPLE_8_MONO;
  60. // -----------------------------------------------------------------------------
  61. //
  62. // @doc     EX_AUDIO_DDSI
  63. //
  64. // @struct  SAMPLE_16_MONO | Single sample from 16-bit mono PCM data stream.
  65. //
  66. // @field   INT16 | sample | Unsigned 16-bit sample
  67. //
  68. // -----------------------------------------------------------------------------
  69. typedef struct  {
  70.     INT16 sample;              // Signed 16-bit sample
  71. } SAMPLE_16_MONO;
  72. // -----------------------------------------------------------------------------
  73. //
  74. // @doc     EX_AUDIO_DDSI
  75. //
  76. // @struct  SAMPLE_8_STEREO | Single sample from 8-bit stereo PCM data stream.
  77. //
  78. // @field   UINT8 | sample_left | Unsigned 8-bit sample from left channel.
  79. //
  80. // @field   UINT8 | sample_right | Unsigned 8-bit sample from right channel.
  81. //
  82. // -----------------------------------------------------------------------------
  83. typedef struct  {
  84.     UINT8 sample_left;         // Unsigned 8-bit sample
  85.     UINT8 sample_right;        // Unsigned 8-bit sample
  86. } SAMPLE_8_STEREO;
  87. // -----------------------------------------------------------------------------
  88. //
  89. // @doc     EX_AUDIO_DDSI
  90. //
  91. // @struct  SAMPLE_16_STEREO | Single sample from 16-bit stereo PCM data stream.
  92. //
  93. // @field   UINT16 | sample_left | Unsigned 16-bit sample from left channel.
  94. //
  95. // @field   UINT16 | sample_right | Unsigned 16-bit sample from right channel.
  96. //
  97. // -----------------------------------------------------------------------------
  98. typedef struct  {
  99.     INT16 sample_left;         // Signed 16-bit sample
  100.     INT16 sample_right;        // Signed 16-bit sample
  101. } SAMPLE_16_STEREO;
  102. // -----------------------------------------------------------------------------
  103. //
  104. // @doc     EX_AUDIO_DDSI
  105. //
  106. // @struct  PCM_SAMPLE | Union that allows access to any of the Sample Types
  107. //
  108. // @field   SAMPLE_8_MONO | m8 | <t SAMPLE_8_MONO>
  109. // @field   SAMPLE_16_MONO | m16 | <t SAMPLE_16_MONO>
  110. // @field   SAMPLE_8_STEREO | s8 | <t SAMPLE_8_STEREO>
  111. // @field   SAMPLE_16_STEREO | s16 | <t SAMPLE_16_STEREO>
  112. //
  113. // -----------------------------------------------------------------------------
  114. typedef union {
  115.      SAMPLE_8_MONO m8;
  116.      SAMPLE_16_MONO m16;
  117.      SAMPLE_8_STEREO s8;
  118.      SAMPLE_16_STEREO s16;
  119. } PCM_SAMPLE, *PPCM_SAMPLE;