#pragma once #ifdef __cplusplus extern "C" { #endif typedef struct ZipVoiceHandle ZipVoiceHandle; typedef struct { const char *root_dir; const char *model_dir; const char *token_file; const char *vocoder_model; int max_tokens; int max_feat_len; int num_step; float default_speed; int seed; } ZipVoiceConfig; typedef struct { const char *text; const char *prompt; // zh / en / custom float speed; const char *output_wav; } ZipVoiceRequestC; typedef struct { int ok; // 1 ok, 0 error const char *path; // output wav path const char *error; // error string, owned by library until next call double wall_sec; double model_sec; double rtf; } ZipVoiceResponseC; ZipVoiceHandle *zipvoice_create(const ZipVoiceConfig *cfg); void zipvoice_destroy(ZipVoiceHandle *h); int zipvoice_cache_prompt(ZipVoiceHandle *h, const char *key, const char *wav_path, const char *prompt_text); ZipVoiceResponseC zipvoice_infer(ZipVoiceHandle *h, const ZipVoiceRequestC *req); #ifdef __cplusplus } #endif