Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 如何将(aiff)文件转换为在windows操作系统上运行的任何格式(.asf、.asx、.avi、.wav、.wax、.wma、.wm、.wmv)?_Objective C_Cocoa Touch_Mp3_Audiotoolbox_Caf - Fatal编程技术网

Objective c 如何将(aiff)文件转换为在windows操作系统上运行的任何格式(.asf、.asx、.avi、.wav、.wax、.wma、.wm、.wmv)?

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

我正在从事一个iPhone项目,希望保存mp3文件而不是汽车,我编写了以下代码以.caf扩展名保存记录文件:

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。

可能与