* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// if(!freq_imag) freq_imag = new double[window_size];
// if(!output_real) output_real = new double[window_size];
// if(!output_imag) output_imag = new double[window_size];
// if(!freq_imag) freq_imag = new double[window_size];
// if(!output_real) output_real = new double[window_size];
// if(!output_imag) output_imag = new double[window_size];
// do_fft(window_size, // must be a power of 2
// 0, // 0 = forward FFT, 1 = inverse
// input_buffer, // array of input's real samples
// 0, // array of input's imag samples
// freq_real, // array of output's reals
// freq_imag);
// do_fft(window_size, // must be a power of 2
// 0, // 0 = forward FFT, 1 = inverse
// input_buffer, // array of input's real samples
// 0, // array of input's imag samples
// freq_real, // array of output's reals
// freq_imag);
// // Crossfade into the output buffer
// long new_allocation = output_size + window_size;
// if(new_allocation > output_allocation)
// {
// double *new_output = new double[new_allocation];
// // Crossfade into the output buffer
// long new_allocation = output_size + window_size;
// if(new_allocation > output_allocation)
// {
// double *new_output = new double[new_allocation];
// i++, j++)
// {
// double src_level = (double)i / HALF_WINDOW;
// double dst_level = (double)(HALF_WINDOW - i) / HALF_WINDOW;
// output_buffer[j] = output_buffer[j] * dst_level + output_real[i] * src_level;
// }
// i++, j++)
// {
// double src_level = (double)i / HALF_WINDOW;
// double dst_level = (double)(HALF_WINDOW - i) / HALF_WINDOW;
// output_buffer[j] = output_buffer[j] * dst_level + output_real[i] * src_level;
// }
-//
-// memcpy(output_buffer + output_size,
-// output_real + HALF_WINDOW,
+//
+// memcpy(output_buffer + output_size,
+// output_real + HALF_WINDOW,
// sizeof(double) * (window_size - HALF_WINDOW));
// output_size += window_size - HALF_WINDOW;
// }
// else
// {
// // First buffer has no crossfade
// sizeof(double) * (window_size - HALF_WINDOW));
// output_size += window_size - HALF_WINDOW;
// }
// else
// {
// // First buffer has no crossfade
// // Have enough to send to output
// int samples_rendered = 0;
// if(output_size - HALF_WINDOW >= size)
// // Have enough to send to output
// int samples_rendered = 0;
// if(output_size - HALF_WINDOW >= size)
// this->input_sample + step * HALF_WINDOW,
// this->input_sample + step * HALF_WINDOW + HALF_WINDOW);
result = read_samples(this->input_sample + step * HALF_WINDOW,
// this->input_sample + step * HALF_WINDOW,
// this->input_sample + step * HALF_WINDOW + HALF_WINDOW);
result = read_samples(this->input_sample + step * HALF_WINDOW,