Closed taroushirani closed 2 years ago
Thank you for your comment.
This error may be caused when an F0 in a frame is under the world::kFloorF0 (71 Hz). We have already modified this problem by adding a safeguard by line 217 in the CheapTrick.cpp, but the pyworld may not include this modification. You can also avoid this problem by directly setting the fft_size to an appropriate value. If you can't solve this problem with this modification, please get in touch with me again.
Thank you for your rapid response.
I built pyworld with the latest World source code via git, and I used fft_size calculated by GetFFTSizeForCheapTrick (because pyworld uses GetFFTSizeForCheapTrick to set fft_size by default). I'm not sure but an inadequate value of f0_floor may result in this phenomenon.
As for now, cutting the length of half_window_length to "(forward_real_fft->fft_size -1) / 2" seems to work fine. Thank you
I think that your approach can work well when the F0 in the frame is above f0_floor. If you want to guarantee the performance of the spectral envelope, I recommend setting the fft_size manually based on the minimum value of F0 contour estimated by Dio() or Harvest().
If you want to keep the current fft_size irrespective of the lower F0 value than the lower limit, your approach seems to be reasonable.
Hello. I met the heap buffer overflow in cheaptrick when I used World via pyworld(version 0.3.0, built with -fsanitize=address option).
In GetWindowedWaveform in cheaptrick.cpp, waveform is ForwardRealFFT.waveform and its size is ForwardRealFFT.fft_size. If half_window_length is bigger than (ForwardRealFFT.fft_size -1 )/ 2, the access by index at line 127 of cheaptrick.cpp may result in heap buffer overflow.
Is there any need to check half_window_length is smaller than (ForwardRealFFT.fft_size -1 )/ 2?