# Block processing in FMOD 5

**URL:** <https://qa.fmod.com/t/block-processing-in-fmod-5/11712>\
**Category:** FMOD Engine\
**Created:** [November 4, 2014, 4:44pm UTC](https://qa.fmod.com/t/block-processing-in-fmod-5/11712 "2014-11-04T16:44:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmora](https://avatars.discourse-cdn.com/v4/letter/j/7bcc69/32.png) [@jmora](https://qa.fmod.com/u/jmora)\
**Post date:** [November 4, 2014, 4:44pm UTC](https://qa.fmod.com/t/block-processing-in-fmod-5/11712/1 "2014-11-04T16:44:54Z")

</div>

FMOD\_DSP\_PROCESS\_CALLBACK, takes inputs of:

```
(
FMOD_DSP_STATE *dsp_state, 
unsigned int length, 
const FMOD_DSP_BUFFER_ARRAY *inbufferarray,
FMOD_DSP_BUFFER_ARRAY *outbufferarray, 
FMOD_BOOL inputsidle, 
FMOD_DSP_PROCESS_OPERATION op
);

```

So if I am given n channels of “length” number of samples, I must output m channels also of the same length.

What happens if I am given 300 samples, but I only process in block sizes of 256, and am thus only able to return 256 samples at a time? There doesn’t seem to be a way to return a partial frame. Can I define a required number of samples per invocation? How are we to handle block based processing?

---

<div class="post-metadata">

**Author:** ![nick1](https://avatars.discourse-cdn.com/v4/letter/n/47e85d/32.png) [@nick1](https://qa.fmod.com/u/nick1)\
**Post date:** [November 4, 2014, 11:34pm UTC](https://qa.fmod.com/t/block-processing-in-fmod-5/11712/2 "2014-11-04T23:34:09Z")

</div>

FMOD will call DSP functions with lengths up to the system block size. The default system block size varies by platform, and can be overriden by the application using System::setDSPBufferSize().

lengths less the system block size are only used at the start and end of processing, so you can zero pad the signal if you want.

Your DSP can query the block size in the FMOD\_DSP\_CREATE\_CALLBACK callback using:

```
int dspBlockSize;
dsp_state->callbacks->getblocksize(dsp_state, &dspBlockSize);

```

and set up your internal block size to match.
