using System.IO; namespace GermanApp.Domain.Interfaces; /// /// Domain interface for Coqui TTS text-to-speech service. /// This is part of the Domain layer. /// public interface ITtsService { /// /// Generates audio from text. /// /// Text to convert to speech /// Speaker ID/voice (optional) /// Language code (default: de) /// Cancellation token /// Audio data as bytes Task GenerateAudioAsync( string text, string? speaker = null, string language = "de", CancellationToken cancellationToken = default); /// /// Generates audio and saves to a file. /// /// Text to convert to speech /// Path to save the audio file /// Speaker ID/voice (optional) /// Language code (default: de) /// Cancellation token /// Path to the generated audio file Task GenerateAudioToFileAsync( string text, string outputPath, string? speaker = null, string language = "de", CancellationToken cancellationToken = default); /// /// Generates audio as a stream. /// /// Text to convert to speech /// Speaker ID/voice (optional) /// Language code (default: de) /// Cancellation token /// Audio stream Task GenerateAudioStreamAsync( string text, string? speaker = null, string language = "de", CancellationToken cancellationToken = default); /// /// Tests the Coqui TTS model and configuration. /// /// Cancellation token /// True if model is loaded and working Task TestModelAsync(CancellationToken cancellationToken = default); /// /// Gets the current TTS model information. /// /// Model name and path Task<(string ModelName, string? ModelPath)> GetModelInfoAsync(); /// /// Gets list of available voices/speakers for the current model. /// /// Cancellation token /// List of available speaker IDs Task> GetAvailableSpeakersAsync(CancellationToken cancellationToken = default); /// /// Cleans up old audio files from storage. /// /// Delete files older than this timespan /// Cancellation token /// Number of files deleted Task CleanupOldFilesAsync( TimeSpan olderThan, CancellationToken cancellationToken = default); }