Objective c 如何将(aiff)文件转换为在windows操作系统上运行的任何格式(.asf、.asx、.avi、.wav、.wax、.wma、.wm、.wmv)?
我正在从事一个iPhone项目,希望保存mp3文件而不是汽车,我编写了以下代码以.caf扩展名保存记录文件:Objective c 如何将(aiff)文件转换为在windows操作系统上运行的任何格式(.asf、.asx、.avi、.wav、.wax、.wma、.wm、.wmv)?,objective-c,cocoa-touch,mp3,audiotoolbox,caf,Objective C,Cocoa Touch,Mp3,Audiotoolbox,Caf,我正在从事一个iPhone项目,希望保存mp3文件而不是汽车,我编写了以下代码以.caf扩展名保存记录文件: NSMutableDictionary* recordSetting = [[NSMutableDictionary alloc] init]; [recordSetting setValue :[NSNumber numberWithInt:kAudioFormatAppleIMA4] forKey:AVFormatIDKey]; [recordSetting setV
NSMutableDictionary* recordSetting = [[NSMutableDictionary alloc] init];
[recordSetting setValue :[NSNumber numberWithInt:kAudioFormatAppleIMA4] forKey:AVFormatIDKey];
[recordSetting setValue:[NSNumber numberWithFloat:44100.0] forKey:AVSampleRateKey];
[recordSetting setValue:[NSNumber numberWithInt: 2] forKey:AVNumberOfChannelsKey];
NSString *recorderFilePath =[NSString stringWithFormat:@"%@/%@.caf", DOCUMENTS_FOLDER,fileName];
我试过这个:
[recordSetting setValue :[NSNumber numberWithInt:kAudioFormatMPEGLayer3] forKey:AVFormatIDKey];
NSString *recorderFilePath =[NSString stringWithFormat:@"%@/%@.mp3", DOCUMENTS_FOLDER,fileName];
但它没有保存成mp3格式!它是否在objective c中可用,或者是否有任何第三方代码使其可用,我在AudioToolbox.framework中看到了该方法:
OSStatus AudioConverterConvertBuffer (
AudioConverterRef inAudioConverter,
UInt32 inInputDataSize,
const void *inInputData,
UInt32 *ioOutputDataSize,
void *outOutputData
);
欢迎任何帮助,谢谢。这里有一个开源项目。挑战在于让它在iphone上运行。将为ios的交叉编译提供指导 另请注意,它是GPL。可能与