成都创新互联网站制作重庆分公司

iOSAVAudioRecorder参数设置

 //------------------ 设置录音格式及参数 --------------------------
       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];

为慈溪等地区用户提供了全套网页设计制作服务,及慈溪网站建设行业解决方案。主营业务为做网站、网站建设、慈溪网站设计,以传统方式定制建设网站,并提供域名空间备案等一条龙服务,秉承以专业、用心的态度为用户提供真诚的服务。我们深信只要达到每一位用户的要求,就会得到认可,从而选择与我们长期合作。这样,我们也可以走得更远!


新闻名称:iOSAVAudioRecorder参数设置
网页地址:http://cxhlcq.com/article/jcheis.html

其他资讯

在线咨询

微信咨询

电话咨询

028-86922220(工作日)

18980820575(7×24)

提交需求

返回顶部