Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added file open and close for C# #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions include/rnnoise.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand All @@ -115,5 +125,3 @@ RNNOISE_EXPORT void rnnoise_model_free(RNNModel *model);
}
#endif
#endif

#endif
16 changes: 16 additions & 0 deletions src/rnn_reader.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down