#pragma once #include #include #include #include #include #include namespace engine::models::piper_tts { struct PiperTtsEncoded { std::vector token_ids; }; class PiperTtsFrontend { public: PiperTtsFrontend( std::filesystem::path espeak_library_path, std::filesystem::path espeak_data_path, std::string espeak_voice, std::unordered_map phoneme_id_map, int64_t max_tokens); ~PiperTtsFrontend(); [[nodiscard]] PiperTtsEncoded encode(const std::string & text) const; private: struct Impl; std::unique_ptr impl_; std::unordered_map id_map_; int64_t max_tokens_; }; } // namespace engine::models::piper_tts