如何在iPhone中以mp3格式录制声音
问题描述:
我想将声音录制在我的iPhone应用程序中,但我只能以某种特定的格式录制它。如何以mp3格式录制 我已经搜索了很多,但找不到解决如何在iPhone中以mp3格式录制声音
我发现AVRecorder不会支持MP3录音,即使有iTunes中许多应用程序,以记录MP3格式
我怎样才能做到这一点,请帮助me..thanks提前
答
的NSString * path = [[NSBundle mainBundle] pathForResource:@ \“mp3Header \”ofType:@ \“mp3 \”];
NSMutableData * audioData = [[NSMutableData alloc] initWithContentsOfFile:path];
int samples = 22050;
uint8_t dataToRecord [samples];
int x;
为(X = 0; X <样本; X ++){
// populate the \"dataToRecord\" array with audio data. //
}
[audioData对appendBytes:(常量无效*)dataToRecord长度:样品];
// Get path to documents folder and set a file name //
[audioData writeToFile:pathToFile atomically:YES];
首先尝试搜索Internet:http://*.com/questions/10314510/how-to-record-audio-as-mp3-file-by-using-avaudiorecorder,http://*.com/questions/ 10549023/iphone-app-recording-audio-in-mp3,http://*.com/questions/4871940/how-to-record-an-audio-file-in-mp3-format,http:// *。 com/questions/1005598 /正在寻找一种方式来编码-iPhone- – CRDave 2013-04-09 10:45:52
记录的文件是.caf文件格式。录制后必须将.caf转换为.mp3文件格式。 – Tirth 2013-04-09 10:53:38
@iAmbitious如何将.caf转换为.mp3 – 2013-04-09 11:27:40