IAudioMeterInformation.cs 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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 Vannatech.CoreAudio.Interfaces
  22. {
  23. /// <summary>
  24. /// Represents a peak meter on the audio stream to or from an audio endpoint device.
  25. /// </summary>
  26. /// <remarks>
  27. /// MSDN Reference: http://msdn.microsoft.com/en-us/library/dd368227.aspx
  28. /// </remarks>
  29. public partial interface IAudioMeterInformation
  30. {
  31. /// <summary>
  32. /// Gets the peak sample value for the channels in the audio stream.
  33. /// </summary>
  34. /// <param name="peak">The peak sample value for the audio stream.</param>
  35. /// <returns>An HRESULT code indicating whether the operation passed of failed.</returns>
  36. [PreserveSig]
  37. int GetPeakValue(
  38. [Out] [MarshalAs(UnmanagedType.R4)] out float peak);
  39. /// <summary>
  40. /// Gets the number of channels in the audio stream that are monitored by peak meters.
  41. /// </summary>
  42. /// <param name="channelCount">The channel count.</param>
  43. /// <returns>An HRESULT code indicating whether the operation passed of failed.</returns>
  44. [PreserveSig]
  45. int GetMeteringChannelCount(
  46. [Out] [MarshalAs(UnmanagedType.U4)] out UInt32 channelCount);
  47. /// <summary>
  48. /// Gets the peak sample values for all the channels in the audio stream.
  49. /// </summary>
  50. /// <param name="channelCount">The channel count.</param>
  51. /// <param name="peakValues">An array of peak sample values.</param>
  52. /// <returns>An HRESULT code indicating whether the operation passed of failed.</returns>
  53. [PreserveSig]
  54. int GetChannelsPeakValues(
  55. [In] [MarshalAs(UnmanagedType.U4)] UInt32 channelCount,
  56. [In, Out] [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.R4)] float[] peakValues);
  57. /// <summary>
  58. /// Queries the audio endpoint device for its hardware-supported functions.
  59. /// </summary>
  60. /// <param name="hardwareSupportMask">A hardware support mask that indicates the capabilities of the endpoint.</param>
  61. /// <returns>An HRESULT code indicating whether the operation passed of failed.</returns>
  62. [PreserveSig]
  63. int QueryHardwareSupport(
  64. [Out] [MarshalAs(UnmanagedType.U4)] out UInt32 hardwareSupportMask);
  65. }
  66. }