Skip to content

Commit

Permalink
add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
voytas committed May 30, 2024
1 parent 835145c commit 5cc6d62
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Beeper/AudioPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,19 @@ public void Stop()
_audioPlayer.Stop();
}

/// <summary>
/// Plays the audio data.
/// </summary>
/// <param name="data">The audio data to play. This is an enumerable collection of bytes.</param>
/// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
public Task Play(IEnumerable<byte> data, CancellationToken cancellationToken = default) =>
Play(new ByteStream(data), cancellationToken);

/// <summary>
/// Plays the audio data from a stream.
/// </summary>
/// <param name="stream">The stream containing audio data to play. This is a Stream object.</param>
/// <param name="cancellationToken">The token to monitor for cancellation requests. </param>
public async Task Play(Stream stream, CancellationToken cancellationToken = default)
{
using var pcmDataReader = new PcmDataReader(stream, _audioFormat);
Expand Down

0 comments on commit 5cc6d62

Please sign in to comment.