AudioBuffer.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // Copyright (c) 2019-2021 Ryujinx
  2. //
  3. // This program is free software: you can redistribute it and/or modify
  4. // it under the terms of the GNU Lesser General Public License as published by
  5. // the Free Software Foundation, either version 3 of the License, or
  6. // (at your option) any later version.
  7. //
  8. // This program is distributed in the hope that it will be useful,
  9. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. // GNU Lesser General Public License for more details.
  12. //
  13. // You should have received a copy of the GNU Lesser General Public License
  14. // along with this program. If not, see <https://www.gnu.org/licenses/>.
  15. //
  16. using Ryujinx.Audio.Integration;
  17. namespace Ryujinx.Audio.Common
  18. {
  19. /// <summary>
  20. /// Represent an audio buffer that will be used by an <see cref="IHardwareDeviceSession"/>.
  21. /// </summary>
  22. public class AudioBuffer
  23. {
  24. /// <summary>
  25. /// Unique tag of this buffer.
  26. /// </summary>
  27. /// <remarks>Unique per session</remarks>
  28. public ulong BufferTag;
  29. /// <summary>
  30. /// Pointer to the user samples.
  31. /// </summary>
  32. public ulong DataPointer;
  33. /// <summary>
  34. /// Size of the user samples region.
  35. /// </summary>
  36. public ulong DataSize;
  37. /// <summary>
  38. /// The timestamp at which the buffer was played.
  39. /// </summary>
  40. /// <remarks>Not used but useful for debugging</remarks>
  41. public ulong PlayedTimestamp;
  42. /// <summary>
  43. /// The user samples.
  44. /// </summary>
  45. public byte[] Data;
  46. }
  47. }