在iPhone上记录“苹果无损”音频
-
22-08-2019 - |
题
您可以点我的文档/片断/博客,这解释 如何记录在iPhone上苹果无损音频文件,好吗?
我已经从Apple检查的音频记录器例如 开发中心,但无法弄清楚,我有设置 用于无损音频。
此致
的Stefan
解决方案
在iPhone OS支持录制使用许多不同的压缩音频编码格式文件的.caf:
苹果无损 - 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开发中心的SpeakHere示例
我用的iTalk记录保费为.AIFF(未压缩),然后导出到笔记本电脑,使用 FLAC 以压缩它 - 默认情况下它保持时间戳
flac --best *.aiff
不隶属于 StackOverflow