#pragma once #include "engine/community_models/inflect_v2/assets.h" #include "engine/framework/runtime/session.h" #include #include #include namespace engine::models::inflect_v2 { struct InflectV2GenerationOptions { float speaking_rate = 1.0F; float variation = 0.667F; uint32_t seed = 0; }; class InflectV2VitsRuntime { public: // `rknn_decoder_path` selects the Rockchip NPU decoder sidecar (see // engine/community_models/inflect_v2/rknn_decoder.h): the latent is then voiced by that // engine instead of the ggml decoder graph, which is never built. InflectV2VitsRuntime( std::shared_ptr assets, core::BackendConfig backend_config, std::string rknn_decoder_path = {}); ~InflectV2VitsRuntime(); runtime::AudioBuffer synthesize( const std::vector & token_ids, const InflectV2GenerationOptions & options); private: struct State; std::unique_ptr state_; }; void apply_inflect_v2_edge_fade( std::vector & samples, int sample_rate, float milliseconds = 5.0F); } // namespace engine::models::inflect_v2