Skip to content

Instantly share code, notes, and snippets.

@saivert
Created March 11, 2023 10:36
Show Gist options
  • Save saivert/fca7b21eae0edb7e53f809646a1579be to your computer and use it in GitHub Desktop.
Save saivert/fca7b21eae0edb7e53f809646a1579be to your computer and use it in GitHub Desktop.
int stride = plugin.fmt.channels * (plugin.fmt.bps / 8);
int buffer_size = 1024 * (plugin.fmt.bps/8) * plugin.fmt.channels;
int bytes_per_channel = (buffer_size > buf->datas[0].maxsize ? buf->datas[0].maxsize : buffer_size) / plugin.fmt.channels;
int nframes = bytes_per_channel / stride;
// nframes is now 512 when I expected 1024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment