Skip to content

Instantly share code, notes, and snippets.

@mitchellporter
Created July 7, 2016 21:57
Show Gist options
  • Select an option

  • Save mitchellporter/fbde3f46c18e6958ad384b211f47d345 to your computer and use it in GitHub Desktop.

Select an option

Save mitchellporter/fbde3f46c18e6958ad384b211f47d345 to your computer and use it in GitHub Desktop.
audio snippet
- (void) audioPCMFrameWasCaptured:(nonnull const AudioStreamBasicDescription *)pcmASBD bufferList:(nonnull const AudioBufferList *)bufferList time:(CMTime)time sampleRate:(Float64)sampleRate {
int16_t *fdata = bufferList->mBuffers[0].mData;
for (int i = 0; i < bufferList->mBuffers[0].mDataByteSize/sizeof(*fdata); i++) {
*fdata = (int16_t)(*fdata * 0.1);
fdata++;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment