IReadableAudioSource.cs 1.3 KB

1234567891011121314151617181920212223242526
  1. namespace Bmp.Core.FFMpeg.CsCorePorts;
  2. /// <summary>
  3. /// Defines a generic base for all readable audio streams.
  4. /// </summary>
  5. /// <typeparam name="T">The type of the provided audio data.</typeparam>
  6. public interface IReadableAudioSource<in T> : IAudioSource
  7. {
  8. /// <summary>
  9. /// Reads a sequence of elements from the <see cref="IReadableAudioSource{T}" /> and advances the position within the
  10. /// stream by the
  11. /// number of elements read.
  12. /// </summary>
  13. /// <param name="buffer">
  14. /// An array of elements. When this method returns, the <paramref name="buffer" /> contains the specified
  15. /// array of elements with the values between <paramref name="offset" /> and (<paramref name="offset" /> +
  16. /// <paramref name="count" /> - 1) replaced by the elements read from the current source.
  17. /// </param>
  18. /// <param name="offset">
  19. /// The zero-based offset in the <paramref name="buffer" /> at which to begin storing the data
  20. /// read from the current stream.
  21. /// </param>
  22. /// <param name="count">The maximum number of elements to read from the current source.</param>
  23. /// <returns>The total number of elements read into the buffer.</returns>
  24. int Read(T[] buffer, int offset, int count);
  25. }