| 69 | } |
| 70 | |
| 71 | void Whisperization::WhisperizationEffect::modification(const int channel) |
| 72 | { |
| 73 | fft->perform(time_domain_buffer, frequency_domain_buffer, false); |
| 74 | |
| 75 | for (int index = 0; index < fft_size / 2 + 1; ++index) { |
| 76 | float magnitude = abs(frequency_domain_buffer[index]); |
| 77 | float phase = 2.0f * M_PI * (float)rand() / (float)RAND_MAX; |
| 78 | |
| 79 | frequency_domain_buffer[index].real(magnitude * cosf(phase)); |
| 80 | frequency_domain_buffer[index].imag(magnitude * sinf(phase)); |
| 81 | |
| 82 | if (index > 0 && index < fft_size / 2) { |
| 83 | frequency_domain_buffer[fft_size - index].real(magnitude * cosf (phase)); |
| 84 | frequency_domain_buffer[fft_size - index].imag(magnitude * sinf (-phase)); |
| 85 | } |
| 86 | } |
| 87 | |
| 88 | fft->perform(frequency_domain_buffer, time_domain_buffer, true); |
| 89 | } |
| 90 | |
| 91 | |
| 92 | // Generate JSON string of this object |
nothing calls this directly
no outgoing calls
no test coverage detected