2010-10-27 20 views
0

从这里下载。这听起来非常呆滞。怎么了?来自AudioUnit的奇怪的呆滞录音

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* [email protected]"/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]; 

回答

0

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

+0

我尝试22050,44100两个。它仍然有这种缓慢。你听到那个声音了吗?听起来很奇怪,对。 – lilzz 2010-10-27 06:12:57