Adjust: init data

dev
xufulong 3 years ago
parent 28f3ae6aaf
commit 3aad838886
  1. 3
      app/src/main/cpp/audio_player.cpp
  2. 3
      app/src/main/cpp/visualizer/execute_fft.c

@ -286,9 +286,6 @@ AUDIO_PLAYER_FUNC(void, play, jstring input_jstr, jstring filter_jstr) {
jmethodID fft_method = env->GetMethodID(player_class, "fftCallbackFromJNI", "([S)V");
auto *fft_filter = static_cast<filter_sys_t *>(malloc(sizeof(filter_sys_t)));
fft_filter->nb_samples = 0;
fft_filter->data_size = 0;
fft_filter->data = nullptr;
init_visualizer(fft_filter);
//read audio frame

@ -203,6 +203,9 @@ int init_visualizer(filter_sys_t *p_filter)
/* Fetch the FFT window parameters */
window_get_param(&p_filter->wind_param);
p_filter->data = NULL;
p_filter->data_size = 0;
p_filter->nb_samples = 0;
p_filter->out_samples = FFT_BUFFER_SIZE;
p_filter->output = (int16_t *) (malloc(p_filter->out_samples * sizeof(int16_t)));
return 0;

Loading…
Cancel
Save