你能给我指一下文档/片段/博客吗,其中解释了 请问如何在iPhone上录制Apple无损音频文件?
我已经检查了 Apple 的录音机示例 开发中心,但无法弄清楚我有哪个设置 用于无损音频。
问候,
斯特凡
最佳答案
iPhone OS 支持使用多种不同的压缩音频编码格式录制 .caf 文件:
Apple 无损 - kAudioFormatAppleLossless
iLBC(互联网低比特率编解码器)-kAudioFormatiLBC
IMA/ADPCM(又名 IMA4)-kAudioFormatAppleIMA4
μLaw - kAudioFormatULaw
aLaw - kAudioFormatALaw
- (id) initWithURL: fileURL {
NSLog (@"initializing a recorder object.");
self = [super init];
if (self != nil) {
// define the audio stream basic description for the file to record into
// record audio at the current hardware sample rate
// make sure the audio session is active before asking for properties
UInt32 propertySize = sizeof(audioFormat.mSampleRate);
AudioSessionGetProperty(kAudioSessionProperty_CurrentHardwareSampleRate,
&propertySize,
&audioFormat.mSampleRate);
audioFormat.mFormatID = kAudioFormatAppleIMA4; // record using IMA4 codec
audioFormat.mChannelsPerFrame = 1;
AudioQueueNewInput(&audioFormat, ... );
...
}
return self;
}
关于iphone - 在iPhone上录制 "Apple lossless"音频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/875252/