tags:

views:

11

answers:

1

Download from here. It sounds very sluggish. what's wrong?

http://www.megaupload.com/?d=XGQS3CA4

AudioStreamBasicDescription audioFormat;
audioFormat.mSampleRate = 22050.0;
audioFormat.mFormatID = kAudioFormatLinearPCM;
audioFormat.mFramesPerPacket = 1;
audioFormat.mChannelsPerFrame = 1;
audioFormat.mBytesPerFrame = 2;
audioFormat.mBytesPerPacket = 2;
audioFormat.mBitsPerChannel = 16;
audioFormat.mReserved = 0;
audioFormat.mFormatFlags = kLinearPCMFormatFlagIsBigEndian |
kLinearPCMFormatFlagIsSignedInteger |
kLinearPCMFormatFlagIsPacked;

//NSString* recordFilePath=[NSTemporaryDirectory() stringByAppendingPathComponent: @"recordedFile.caf"];
NSString* recordFilePath=@"/recordedFile.caf";

NSURL *toURL = [NSURL fileURLWithPath:recordFilePath];





ExtAudioFileCreateWithURL((CFURLRef)toURL, 
                          kAudioFileCAFType, 
                          &audioFormat,
                          NULL, 
                          kAudioFileFlags_EraseFile, 
                          &extAudioFile);

ExtAudioFileSetProperty(extAudioFile,
                      kExtAudioFileProperty_ClientDataFormat, 
                       sizeof(AudioStreamBasicDescription), 
                       &audioUnitOutputFormat);

ExtAudioFileSeek(extAudioFile, 0);

[self EnableAudioInputiPhone];
A: 

Is the actual recording sample rate 44100, contrary to your specified file format?

hotpaw2
I try both 22050, 44100. It still has that sluggishness. Have you heard that sound? it sounds weird, right.