이전에 성공적으로 완료된 iOS 앱에 AMR-NB 디코딩 지원을 추가하려고했습니다. 그러나 내가 사용한 프레임 워크 (PhoneGap, 현재는 Cordova)를 업그레이드 한 이후로 새 프로젝트를 시작하고 모든 코드를 새 코드로 마이그레이션하면 AMR-NB 라이브러리가 링크 구문을 작성하는 동안 오류가 발생하기 시작합니다.xCode 4.3.2 링크 오류가 있지만 아치가 있습니다. 왜?
, 그리고 지방 LIB는 i386을 아치가 들어 확인했다, 그것은 이미 연결 구문에 포함 빌드 구. 나는 새 프로젝트와 이전 프로젝트의 빌드 설정을 비교해 왔지만이를 해결할 운이 없다.
내가 잘못 알고있는 사람이 누구인가요? 고마워!
업데이트 :
amrFileCodec.h
// amrFileCodec.h
// Created by Tang Xiaoping on 9/27/11.
// Copyright 2011 test. All rights reserved.
#ifndef amrFileCodec_h
#define amrFileCodec_h
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "interf_dec.h"
#include "interf_enc.h"
...
// 将AMR文件解码成WAVE文件
int DecodeAMRFileToWAVEFile(const char* pchAMRFileName, const char* pchWAVEFilename);
#endif
에게 CJ-Func.m
// CJ-Func.m
// iBear
// Created by Chris Jiang on 11-4-22.
// Copyright 2011 Individual. All rights reserved.
#import "CJ-Func.h"
#import "interf_dec.h"
#import "interf_enc.h"
#import "amrFileCodec.h"
@implementation MyPGPlugFunc
...
- (void)decodeAMR:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options {
NSArray *currentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *basePath = [currentPaths objectAtIndex:0];
NSString *wavDir = [basePath stringByAppendingPathComponent:@"tmp/wav"];
NSString *wavPath = [basePath stringByAppendingPathComponent:[arguments objectAtIndex:1]];
NSLog(@"[CJ-FUNC] Decoding %@ to %@", [arguments objectAtIndex:0], wavPath);
BOOL isDir = YES;
NSFileManager *fileMgr = [NSFileManager defaultManager];
if (![fileMgr fileExistsAtPath:wavDir isDirectory:&isDir]) {
if (![fileMgr createDirectoryAtPath:wavDir withIntermediateDirectories:YES attributes:nil error:nil])
NSLog(@"[CJ-FUNC] ERROR: tmp/wav directory creation failed");
else
NSLog(@"[CJ-FUNC] tmp/wav directory created");
}
[fileMgr release];
int encRes = DecodeAMRFileToWAVEFile(
[[arguments objectAtIndex:0] cStringUsingEncoding:NSASCIIStringEncoding],
[wavPath cStringUsingEncoding:NSASCIIStringEncoding]
);
if (encRes <= 0)
[self writeJavascript:[NSString stringWithFormat:@"%@();", [arguments objectAtIndex:3]]];
else
[self writeJavascript:[NSString stringWithFormat:@"%@('%@');", [arguments objectAtIndex:2], wavPath]];
}
@end
나는 5 일 이후로 이러한 유형의 구현을 찾고 있습니다. 귀하의 코드로 성공적으로 완료되었습니다. 감사합니다 ... 해피 코딩. –