首页 > 其他 > 详细

iOS AVAudioRecorder参数设置

时间:2014-02-19 11:32:37      阅读:951      评论:0      收藏:0      [点我收藏+]

 //------------------ 设置录音格式及参数 --------------------------
       NSDictionary *settings = [[NSDictionary alloc] initWithObjectsAndKeys:
                                 [NSNumber numberWithInt:AVAudioQualityMin], AVEncoderAudioQualityKey,
                                 [NSNumber numberWithInt:kAudioFormatLinearPCM], AVFormatIDKey,
                                 [NSNumber numberWithFloat:8000.0], AVSampleRateKey,
                                 [NSNumber numberWithInt:16],  AVLinearPCMBitDepthKey,
                                 [NSNumber numberWithInt:1],   AVNumberOfChannelsKey,
                                 [NSNumber numberWithBool:NO], AVLinearPCMIsBigEndianKey,
                                 [NSNumber numberWithBool:NO], AVLinearPCMIsFloatKey, nil];

//        NSDictionary *settings = [[NSDictionary alloc] initWithObjectsAndKeys:
//                                   [NSNumber numberWithInt:kAudioFormatLinearPCM],AVFormatIDKey,//格式
//                                   [NSNumber numberWithFloat:8000.0],AVSampleRateKey, //采样率8000次
//                                   [NSNumber numberWithInt:1], AVNumberOfChannelsKey, //通道的数目
//                                   [NSNumber numberWithInt:16],AVLinearPCMBitDepthKey, //采样位数 默认 16
//                                   [NSNumber numberWithBool:NO],AVLinearPCMIsBigEndianKey, //大端还是小端 是内存的组织方式
//                                   [NSNumber numberWithBool:NO],AVLinearPCMIsFloatKey, //采样信号是整数还是浮点数
//                                   //Encoder
//                                   [NSNumber numberWithInt:12800],AVEncoderBitRateKey, //解码率
//                                   [NSNumber numberWithInt:8],AVEncoderBitDepthHintKey, //位深度
//                                   [NSNumber numberWithInt:8],AVEncoderBitRatePerChannelKey, //声道采样率
//                                   [NSNumber numberWithInt:AVAudioQualityLow],AVEncoderAudioQualityKey, //音频编码质量
//                                   nil];

[[AVAudioRecorder alloc] initWithURL:[NSURL fileURLWithPath:cafFilePath] settings:settings error:&error];

iOS AVAudioRecorder参数设置

原文:http://leerain.blog.51cto.com/8277864/1360147

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!