我想知道是否可以用Xcode以编程方式录制mp3格式的音频文件.
我已经阅读了大量的文件,我已经用Google搜索了,但没有结果.
请帮忙,如果有人知道这是怎么回事?
当我从iphone录制音频时如下:
//Setup the dictionary object with all the recording settings that this
//Recording sessoin will use
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];
//Now that we have our settings we are going to instanciate an instance of our recorder instance.
//Generate a temp file for use by the recording.
NSDate *now = [NSDate dateWithTimeIntervalSinceNow:0];
NSString *caldate = [now description];
recordedTmpFile = [[NSString stringWithFormat:@"%@/%@.caf", DOCUMENTS_FOLDER, caldate] retain];
NSLog(@"Using …Run Code Online (Sandbox Code Playgroud)