# Migrate from processBlock to getNextAudioBlock

**URL:** <https://forum.juce.com/t/migrate-from-processblock-to-getnextaudioblock/63962>\
**Category:** General JUCE discussion\
**Created:** [October 28, 2024, 9:00am UTC](https://forum.juce.com/t/migrate-from-processblock-to-getnextaudioblock/63962 "2024-10-28T09:00:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dhng22](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/dhng22/32/16493_2.png) [@dhng22](https://forum.juce.com/u/dhng22)\
**Post date:** [October 28, 2024, 9:00am UTC](https://forum.juce.com/t/migrate-from-processblock-to-getnextaudioblock/63962/1 "2024-10-28T09:00:23Z")

</div>

Hi, I want to use the code from this repo to my project:

> **[GitHub - Chowdhury-DSP/PitchShift: A pitch-shifter example using the Bungee library](https://github.com/Chowdhury-DSP/PitchShift)**
>
> A pitch-shifter example using the Bungee library

However, the repo use processBlock() while I’m using getNextAudioBlock() and get audio block dynamic base on audio speed. As I understand, processBlock() process the whole audio, while getNextAudioBlock() process audio by chunks.

So my question is how to integrate processBlock() to getNextAudioBlock() scheme. Thanks for any help

---

<div class="post-metadata">

**Author:** ![daniel](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/daniel/32/790_2.png) [@daniel](https://forum.juce.com/u/daniel)\
**Post date:** [October 28, 2024, 10:07am UTC](https://forum.juce.com/t/migrate-from-processblock-to-getnextaudioblock/63962/2 "2024-10-28T10:07:26Z")

</div>

You can easily create a proxy buffer that contains only the active region of your AudioSourceChannelInfo

```auto
void getNextAudioBlock(const juce::AudioSourceChannelInfo& info)
{
    juce::AudioBuffer<float> buffer (
        info.buffer->getArrayOfWritePointers(),
        info.buffer->getNumChannels(),
        info.startSample,
        info.numSamples());

    juce::MidiBuffer midiDummy;

    processor->processBlock (buffer, midiDummy);
}

```
