namespace GermanApp.Domain.Interfaces; /// /// Domain interface for Vosk speech recognition service. /// This is part of the Domain layer. /// public interface IVoskService { /// /// Recognizes speech from audio bytes. /// /// Audio data in bytes (WAV format) /// Sample rate of the audio in Hz /// Optional hint/phrase to improve recognition accuracy /// Cancellation token /// Recognized text Task RecognizeSpeechAsync( byte[] audioBytes, int sampleRate = 16000, string? hint = null, CancellationToken cancellationToken = default); /// /// Recognizes speech from an audio file path. /// /// Path to the audio file /// Cancellation token /// Recognized text Task RecognizeSpeechFromFileAsync( string audioFilePath, CancellationToken cancellationToken = default); /// /// Recognizes speech from a stream. /// /// Audio stream /// Sample rate of the audio in Hz /// Cancellation token /// Recognized text Task RecognizeSpeechFromStreamAsync( System.IO.Stream audioStream, int sampleRate = 16000, CancellationToken cancellationToken = default); /// /// Tests the Vosk model and configuration. /// /// Cancellation token /// True if model is loaded and working Task TestModelAsync(CancellationToken cancellationToken = default); /// /// Gets the current Vosk model information. /// /// Model name and path Task<(string ModelName, string ModelPath)> GetModelInfoAsync(); }