AudioUnit发出奇怪的低音录音

时间:2010-10-27 04:22:45

标签: iphone audio

从这里下载。听起来很迟钝。怎么了?

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];

1 个答案:

答案 0 :(得分:0)

实际录制采样率是44100,与指定的文件格式相反吗?