Hi I've been trying to create a wav audio file from the below code, but keep getting the error Creating file ('fmt?'). Can anyone help me out here ? Thanks.
My log : *2012-11-01 13:33:14.183 Novocaine iOS Example[7456:c07] URL: file://localhost/Users/pier/Library/Application%20Support/iPhone%20Simulator/6.0/Applications/01EBF2C0-2C3A-490D-835E-9C39A3E88E0B/Documents/testrecording.wav
Error: Creating file ('fmt?')*
- (id)initWithAudioFileURL:(NSURL *)urlToAudioFile samplingRate:(float)thisSamplingRate numChannels:(UInt32)thisNumChannels
{
self = [super init];
if (self)
{
// Zero-out our timer, so we know we're not using our callback yet
self.callbackTimer = nil;
// Open a reference to the audio file
self.audioFileURL = urlToAudioFile;
CFURLRef audioFileRef = (CFURLRef)self.audioFileURL;
AudioStreamBasicDescription outputFileDesc;
// Set a few defaults and presets
self.samplingRate = thisSamplingRate;
self.numChannels = thisNumChannels;
self.currentTime = 0.0;
self.latency = .011609977; // 512 samples / ( 44100 samples / sec ) default
outputFileDesc.mSampleRate = self.samplingRate;
outputFileDesc.mFormatID = kAudioFormatLinearPCM;
outputFileDesc.mFormatFlags = kAudioFormatFlagIsFloat;
outputFileDesc.mBytesPerPacket = 4*self.numChannels;
outputFileDesc.mFramesPerPacket = 1;
outputFileDesc.mBytesPerFrame = 4*self.numChannels;
outputFileDesc.mChannelsPerFrame = self.numChannels;
outputFileDesc.mBitsPerChannel = 32;
CheckError(ExtAudioFileCreateWithURL(audioFileRef, kAudioFileWAVEType, &outputFileDesc, NULL, kAudioFileFlags_EraseFile, &_outputFile), "Creating file");
. . .