feat: initial whipser transcriber implementation

This commit is contained in:
Stevan Freeborn
2025-07-29 18:00:09 -05:00
parent 5ee040f2d0
commit ef45a4098a
19 changed files with 234 additions and 89 deletions
@@ -1,12 +1,17 @@
using System.Runtime.CompilerServices;
namespace StreamShorts.Library.Transcription;
/// <summary>
/// Represents a transcriber interface for audio transcription.
/// </summary>
public interface ITranscriber
{
IAsyncEnumerable<TranscriptionSegment> TranscribeAsync(Stream audio);
/// <summary>
/// Transcribes the audio stream into text segments.
/// </summary>
/// <param name="audio">The audio stream to transcribe.</param>
/// <param name="cancellationToken">A cancellation token to cancel the operation.</param>
/// <returns>An <see cref="IAsyncEnumerable{T}"/> where T is <see cref="TranscriptionSegment"/>.</returns>
IAsyncEnumerable<TranscriptionSegment> TranscribeAsync(Stream audio, CancellationToken cancellationToken = default);
}
public record TranscriptionSegment(
TimeSpan StartTime,
TimeSpan EndTime,
string Text
);