Created
February 8, 2013 02:00
-
-
Save psugihara/4736032 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSArray *pathComponents = @[[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject], | |
fileName]; | |
NSURL *outputFileURL = [NSURL fileURLWithPathComponents:pathComponents]; | |
AudioFileWriter *fileWriter = [[AudioFileWriter alloc] | |
initWithAudioFileURL:outputFileURL | |
samplingRate:_audioManager.samplingRate | |
numChannels:_audioManager.numInputChannels]; | |
float data[_loopLength * _audioManager.numInputChannels]; | |
_loopBuffer->FetchInterleavedData(data, _loopLength, _audioManager.numInputChannels); | |
[fileWriter writeNewAudio:data | |
numFrames:_loopLength | |
numChannels:_audioManager.numInputChannels]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment