转化变声,时长不对,因为转换的配置设置的不对。
let recordSettings: [String: Any] = [
AVFormatIDKey: kAudioFormatLinearPCM,
AVEncoderAudioQualityKey: 2,
AVNumberOfChannelsKey: 2,
AVSampleRateKey: 8000.0,
AVLinearPCMBitDepthKey: 16
]
lame_t lame = lame_init();
lame_set_in_samplerate(lame, 8000.0);
lame_set_num_channels(lame, 2);//通道
lame_set_quality(lame, 2);//质量
//lame_set_VBR(lame, vbr_default);
lame_set_brate(lame, 16);
lame_set_mode(lame, 3);
lame_init_params(lame);
网友评论