When I use the C API, the audio noise reduction effect is different from the binary execution effect downloaded from the github release page.
Finding the difference
I carefully compared the implementation of the following two files:
libDF/src/bin/enhance_wav.rslibDF/src/capi.rs
I found that RuntimeParams did not initialize all parameters in the capi.rs file. It only publish two functions, df_set_atten_lim() and df_set_post_filter_beta(), to set the values of atten_lim_db and post_filter_beta in RuntimeParams.
In the enhance_wav.rs file, the command parser default_value_t is used to assign initial values to each member variable of struct RuntimeParams.
Why do this changes
When I use the C API, the audio noise reduction effect is different from the binary execution effect downloaded from the github release page.
Finding the difference
I carefully compared the implementation of the following two files:
libDF/src/bin/enhance_wav.rs
libDF/src/capi.rs
I found that RuntimeParams did not initialize all parameters in the
capi.rs
file. It only publish two functions,df_set_atten_lim()
anddf_set_post_filter_beta()
, to set the values ofatten_lim_db
andpost_filter_beta
in RuntimeParams.In the
enhance_wav.rs
file, the command parser default_value_t is used to assign initial values to each member variable of struct RuntimeParams.enhance_wav.rs RuntimeParams default value:
Currently(before this pull requests) capi.rs RuntimeParams's default value:
reference link: libDF/src/tract.rs#L176C1-L187C6