我正在录音。我能够以.caf(核心音频格式)录制音频,后来需要将其转换为.wav或.wma以便将文件上传到FTP服务器。如何在iOS中将文件转换为.wav或.wma格式?使用来自GitHub的POVoiceHUD代码。任何人都可以帮助我解决我的问题。
首先,您必须在给定的以下行中将保存文件扩展名.caf更改为.wav
[self.voiceHud startForFilePath:[NSString stringWithFormat:@"%@/Documents/MySound.wav", NSHomeDirectory()]];
然后转到方法(startForFilePath :)更改语音质量的设置。
NSDictionary *recordSettings = [NSDictionary
dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:AVAudioQualityMin],
AVEncoderAudioQualityKey,
[NSNumber numberWithInt:16],
AVEncoderBitRateKey,
[NSNumber numberWithInt: 2],
AVNumberOfChannelsKey,
[NSNumber numberWithFloat:8000.0], AVSampleRateKey,
[NSNumber numberWithInt:8], AVLinearPCMBitDepthKey,
nil];
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句