diff --git a/include/rnnoise.h b/include/rnnoise.h index 4e42b784..1fe79b20 100644 --- a/include/rnnoise.h +++ b/include/rnnoise.h @@ -97,6 +97,16 @@ RNNOISE_EXPORT void rnnoise_destroy(DenoiseState *st); */ RNNOISE_EXPORT float rnnoise_process_frame(DenoiseState *st, float *out, const float *in); +/** + * Load a system file + */ +RNNOISE_EXPORT FILE *rnnoise_system_open_file(const char* filename, const char* mode); + +/** + * Free a system file + */ +RNNOISE_EXPORT int rnnoise_system_close_file(FILE *f); + /** * Load a model from a file * @@ -115,5 +125,3 @@ RNNOISE_EXPORT void rnnoise_model_free(RNNModel *model); } #endif #endif - -#endif diff --git a/src/rnn_reader.c b/src/rnn_reader.c index 2a031db1..85d3b258 100644 --- a/src/rnn_reader.c +++ b/src/rnn_reader.c @@ -42,6 +42,22 @@ #define F_ACTIVATION_SIGMOID 1 #define F_ACTIVATION_RELU 2 +/** + * Load a system file + */ +FILE *rnnoise_system_open_file(const char* filename, const char* mode) +{ + return fopen(filename, mode); +} + +/** + * Free a system file + */ +int rnnoise_system_close_file(FILE *f) +{ + return fclose(f); +} + RNNModel *rnnoise_model_from_file(FILE *f) { int i, in;