| class TTSEngine { | |
| public: | |
| TTSEngine(const std::string& encoder_model, | |
| const std::string& decoder_model); | |
| ~TTSEngine(); | |
| // Synthesize: returns PCM float32 samples at 24kHz | |
| std::vector<float> synthesize(const std::string& text, | |
| float speed = 1.0f, | |
| float variation = 0.667f); | |
| private: | |
| void* enc_engine_ = nullptr; | |
| void* enc_context_ = nullptr; | |
| void* dec_engine_ = nullptr; | |
| void* dec_context_ = nullptr; | |
| // NPU inference helpers | |
| std::vector<float> encode(const int64_t* tokens, int token_len); | |
| std::vector<float> decode(const float* z_p, int mel_len); | |
| }; | |