#pragma once #include #include #include #include namespace celuna { enum class STTMode { PASSIVE, // Keyword spotting (économe) ACTIVE // Full transcription }; enum class STTEngineType { VOSK, POCKETSPHINX, WHISPER_CPP, WHISPER_API, AUTO // Factory choisit }; /** * @brief Callback pour résultats transcription */ using TranscriptionCallback = std::function; /** * @brief Callback pour détection keyword */ using KeywordCallback = std::function; /** * @brief Interface service STT * * Provides high-level STT functionality with: * - Passive mode (keyword spotting) * - Active mode (full transcription) * - Automatic engine switching * - Fallback support */ class ISTTService { public: virtual ~ISTTService() = default; /** * @brief Démarre le service STT */ virtual bool start() = 0; /** * @brief Arrête le service STT */ virtual void stop() = 0; /** * @brief Change le mode STT */ virtual void setMode(STTMode mode) = 0; /** * @brief Obtient le mode actuel */ virtual STTMode getMode() const = 0; /** * @brief Transcrit un fichier audio */ virtual std::string transcribeFile(const std::string& filePath) = 0; /** * @brief Transcrit des données audio PCM */ virtual std::string transcribe(const std::vector& audioData) = 0; /** * @brief Active l'écoute en streaming (temps réel) */ virtual void startListening(TranscriptionCallback onTranscription, KeywordCallback onKeyword) = 0; /** * @brief Arrête l'écoute streaming */ virtual void stopListening() = 0; /** * @brief Configure la langue */ virtual void setLanguage(const std::string& language) = 0; /** * @brief Vérifie si le service est disponible */ virtual bool isAvailable() const = 0; /** * @brief Obtient le nom de l'engine actuel */ virtual std::string getCurrentEngine() const = 0; }; } // namespace celuna