WAVEFORMATEX.cs 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. // -----------------------------------------
  2. // SoundScribe (TM) and related software.
  3. //
  4. // Copyright (C) 2007-2011 Vannatech
  5. // http://www.vannatech.com
  6. // All rights reserved.
  7. //
  8. // This source code is subject to the MIT License.
  9. // http://www.opensource.org/licenses/mit-license.php
  10. //
  11. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  13. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  14. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  15. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  16. // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  17. // THE SOFTWARE.
  18. // -----------------------------------------
  19. using System;
  20. using System.Runtime.InteropServices;
  21. namespace CoreAudioTests.Common
  22. {
  23. /// <summary>
  24. /// Defines the format of waveform-audio data.
  25. /// </summary>
  26. /// <remarks>
  27. /// MSDN Reference: http://msdn.microsoft.com/en-us/library/dd757720.aspx
  28. /// </remarks>
  29. [StructLayout(LayoutKind.Sequential)]
  30. public struct WAVEFORMATEX
  31. {
  32. /// <summary>
  33. /// Waveform-audio format type.
  34. /// </summary>
  35. public UInt16 wFormatTag;
  36. /// <summary>
  37. /// Number of audio channels.
  38. /// </summary>
  39. public UInt16 nChannels;
  40. /// <summary>
  41. /// Sample rate, in samples per second (hertz).
  42. /// </summary>
  43. public UInt32 nSamplesPerSec;
  44. /// <summary>
  45. /// The required average data-transfer rate, in bytes per second, for the format tag.
  46. /// </summary>
  47. public UInt32 nAvgBytesPerSec;
  48. /// <summary>
  49. /// Block alignment, in bytes.
  50. /// </summary>
  51. public UInt16 nBlockAlign;
  52. /// <summary>
  53. /// Bits per sample for the format type.
  54. /// </summary>
  55. public UInt16 wBitsPerSample;
  56. /// <summary>
  57. /// Size, in bytes, of extra format information appended to the end of the structure.
  58. /// </summary>
  59. public UInt16 cbSize;
  60. }
  61. }