2009-05-17 111 views
2

您能指出我的文档/片段/博客吗?请解释如何在iPhone上记录Apple无损音频文件。请在iPhone上记录“Apple lossless”音频

我检查了开发中心的Apple 音频记录器示例,但无法弄清楚,我有 用于无损音频的设置。

问候,

斯特凡

回答

6

的iPhone OS支持记录使用多种不同的压缩音频编码格式文件的.caf:

苹果无损 - kAudioFormatAppleLossless

的iLBC(互联网低比特率的编码解码器) - kAudioFormatiLBC

IMA/ADPCM(又名IMA4) - kAudioFormatAppleIMA4

μLaw - kAudioFormatULaw

阿劳 - 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; 
} 

你肯定会想阅读Audio Queue Services Programming Guide

0

看看在苹果iPhone开发中心SpeakHere例子。

+0

我已经使用了SpeakHere。但它是用于录制CAF的,可惜MP4没有损失。不管怎么说,还是要谢谢你。 – Stefan 2009-05-17 20:16:51

0

我用的iTalk记录保费为.AIFF(未压缩),然后导出到笔记本电脑,并使用后手压缩它 - 它默认情况下保留时间戳。

flac --best *.aiff