0

当我在链接的框架和库上单击“+”时,我正在添加一个框架我想添加一个音频工具包框架和核心音频我如何添加这两个框架。因为它们不在库中,请帮助我.

NSArray *pathComponents = [NSArray arrayWithObjects:
                               [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject],
                               @"MyAudioMemo.m4a",
                               nil];
    NSURL *outputFileURL = [NSURL fileURLWithPathComponents:pathComponents];

    // Setup audio session
    AVAudioSession *session = [AVAudioSession sharedInstance];
    [session setCategory:AVAudioSessionCategoryPlayAndRecord error:nil];

    // Define the recorder setting
    NSMutableDictionary *recordSetting = [[NSMutableDictionary alloc] init];

    [recordSetting setValue:[NSNumber numberWithInt:kAudioFormatMPEG4AAC] forKey:AVFormatIDKey];
    [recordSetting setValue:[NSNumber numberWithFloat:44100.0] forKey:AVSampleRateKey];
    [recordSetting setValue:[NSNumber numberWithInt: 2] forKey:AVNumberOfChannelsKey];

// Initiate and prepare the recorder
recorder = [[AVAudioRecorder alloc] initWithURL:outputFileURL settings:recordSetting error:nil];
recorder.delegate = self;
recorder.meteringEnabled = YES;
[recorder prepareToRecord];
4

2 回答 2

0

确保该框架在路径中可用,../Developer/SDKs/iPhoneOS(version).sdk/System/Library/Frameworks/否则您必须重新安装 SDK

于 2013-04-08T06:56:37.300 回答
0

请检查这个项目设置->构建阶段->将二进制文件与库链接

在此处输入图像描述

并确保添加了有关 AV 基础工作的框架工作。

在此处输入图像描述

于 2013-04-08T07:03:55.423 回答