aissia/src/services/ISTTService.hpp
StillHammer d17ee5fbdc feat: AISSIA rename and codebase updates
- Renamed project from Celuna to AISSIA
- Updated all documentation and configuration files
- Codebase improvements and fixes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 18:37:13 +07:00

104 lines
2.3 KiB
C++

#pragma once
#include <string>
#include <vector>
#include <functional>
#include <memory>
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<void(const std::string& text, STTMode mode)>;
/**
* @brief Callback pour détection keyword
*/
using KeywordCallback = std::function<void(const std::string& keyword)>;
/**
* @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<float>& 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