2

你能指出我的文档/片段/博客,它解释了如何在 iPhone 上录制苹果无损音频文件,好吗?

我检查了 Apple Dev Center 中的录音机示例,但无法弄清楚我将哪个设置用于无损音频。

问候,

斯特凡

4

3 回答 3

6

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

Apple Lossless - kAudioFormatAppleLossless

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

IMA/ADPCM (aka 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;
}

您肯定想阅读音频队列服务编程指南

于 2009-05-20T15:42:19.480 回答
0

查看 Apple iPhone 开发中心上的 SpeakHere 示例。

于 2009-05-17T19:55:49.787 回答
0

我将 iTalk Recorder Premium 用于 .aiff(未压缩),然后导出到笔记本电脑并使用flac对其进行压缩 - 默认情况下会保留时间戳。

flac --best *.aiff
于 2015-03-22T14:25:24.893 回答