| 28 | } |
| 29 | |
| 30 | void SpectralAudioProcessorInteractor::process(std::vector<std::vector<float>>* input, std::vector<std::vector<float>>* output) |
| 31 | { |
| 32 | m_isPlaying = true; |
| 33 | //need to take pointer to vector of vector of float |
| 34 | jassert(input != nullptr); |
| 35 | jassert(output != nullptr); |
| 36 | jassert(input->size() > 0); |
| 37 | jassert(input->at(0).size() > 0); |
| 38 | jassert(input->size() == output->size()); |
| 39 | jassert(input->size() == m_spectralProcess.size()); |
| 40 | |
| 41 | for (size_t chan = 0; chan < input->size(); chan++) { |
| 42 | if (input->at(chan).size() == 0) |
| 43 | { |
| 44 | continue; |
| 45 | } |
| 46 | |
| 47 | if (m_spectralProcess.size() <= chan) |
| 48 | { |
| 49 | continue; |
| 50 | } |
| 51 | |
| 52 | for (auto& spectralProcessOverlap : m_spectralProcess.at(chan)) { |
| 53 | prepareProcess(spectralProcessOverlap.get()); |
| 54 | spectralProcessOverlap->process(input->at(chan).data(), output->at(chan).data(), m_fftHopSize); |
| 55 | } |
| 56 | } |
| 57 | m_isPlaying = false; |
| 58 | } |
| 59 | |
| 60 | void SpectralAudioProcessorInteractor::setFftSize(int fftSize) |
| 61 | { |