Skip to content

Instantly share code, notes, and snippets.

@saiday
Last active July 13, 2016 13:37
Show Gist options
  • Select an option

  • Save saiday/b7c00117bf49b32cf8944d275abe8e9f to your computer and use it in GitHub Desktop.

Select an option

Save saiday/b7c00117bf49b32cf8944d275abe8e9f to your computer and use it in GitHub Desktop.
FFT computation
NSError *computationError;
AVAudioFile *audioFile = [[AVAudioFile alloc] initForReading:[NSURL fileURLWithPath:self.filePath] error:&computationError];
if (computationError) {
failure(computationError);
return;
}
AVAudioFormat *audioFormat = audioFile.processingFormat;
UInt32 audioFrameCount = (UInt32) audioFile.length;
AVAudioPCMBuffer *buffer = [[AVAudioPCMBuffer alloc] initWithPCMFormat:audioFormat frameCapacity:audioFrameCount];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment