Iphone 如何使用AvAudiorecorder将音频录制为mp3文件
如何使用AvAudiorecorder将音频录制为mp3文件。我使用以下代码设置录音机Iphone 如何使用AvAudiorecorder将音频录制为mp3文件,iphone,record,avaudiorecorder,Iphone,Record,Avaudiorecorder,如何使用AvAudiorecorder将音频录制为mp3文件。我使用以下代码设置录音机 recordSetting1 = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:AVAudioQualityMin],AVEncoderAudioQualityKey, [NSNumber numberWithInt:16],
recordSetting1 = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:AVAudioQualityMin],AVEncoderAudioQualityKey,
[NSNumber numberWithInt:16],
AVEncoderBitRateKey,
[NSNumber numberWithInt: 2],
AVNumberOfChannelsKey,
[NSNumber numberWithFloat:44100.0],
AVSampleRateKey,nil];
加
但是,由于版权问题,无法在IPhone上对mp3格式进行编码。虽然您可以使用
AVAudioPlayer
播放mp3文件,但无法使用AVAudioRecorder
以mp3格式录制(请参阅和)。如果您需要压缩格式,但不必是MP3格式,我建议您使用AAC格式录制。感谢您的反馈,我使用了此格式,但收到错误“error Domain=NSOSStatusErrorDomain Code=1718449215”操作无法完成。(OSStatus错误1718449215。)。请向我提供完整的设置代码,如果可能,请提前感谢。可能的副本
[NSNumber numberWithInt:kAudioFormatMPEGLayer3] forKey:AVFormatIDKey