新聞中心
//------------------ 設(shè)置錄音格式及參數(shù) --------------------------
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, //通道的數(shù)目
// [NSNumber numberWithInt:16],AVLinearPCMBitDepthKey, //采樣位數(shù) 默認(rèn) 16
// [NSNumber numberWithBool:NO],AVLinearPCMIsBigEndianKey, //大端還是小端 是內(nèi)存的組織方式
// [NSNumber numberWithBool:NO],AVLinearPCMIsFloatKey, //采樣信號是整數(shù)還是浮點數(shù)
// //Encoder
// [NSNumber numberWithInt:12800],AVEncoderBitRateKey, //解碼率
// [NSNumber numberWithInt:8],AVEncoderBitDepthHintKey, //位深度
// [NSNumber numberWithInt:8],AVEncoderBitRatePerChannelKey, //聲道采樣率
// [NSNumber numberWithInt:AVAudioQualityLow],AVEncoderAudioQualityKey, //音頻編碼質(zhì)量
// nil];
[[AVAudioRecorder alloc] initWithURL:[NSURL fileURLWithPath:cafFilePath] settings:settings error:&error];
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。
文章名稱:iOSAVAudioRecorder參數(shù)設(shè)置-創(chuàng)新互聯(lián)
本文來源:http://www.dlmjj.cn/article/jhiic.html