繁体   English   中英

AVAudioRecorder默认记录设置

[英]AVAudioRecorder Default Record Setting

我正在使用AVAudioRecorder录制音频。 我正在使用以下代码:

[[AVAudioRecorder分配] initWithURL:outputFileURL设置:recordSetting错误:NULL];

我想知道如果我将recordSetting设置为nil,那么此Recorder使用的默认记录设置是什么。 我的意思是,如果我们将设置参数传入nil,则AVFormatIDKey,AVSampleRateKey,AVEncoderBitRateKey,AVNumberOfChannelsKey和AVAudioQualityMax的值将是多少。

我需要这些键的默认值。

我将不胜感激任何帮助。

以下是可以设置的默认录像机设置。

NSMutableDictionary recordSetting = [[NSMutableDictionary alloc] init];

[recordSetting setValue:[NSNumber numberWithInt:kAudioFormatMPEG4AAC] forKey:AVFormatIDKey];
[recordSetting setValue:[NSNumber numberWithFloat:44100.0] forKey:AVSampleRateKey];
[recordSetting setValue:[NSNumber numberWithInt: 2] forKey:AVNumberOfChannelsKey];

默认的AVAudioRecorder设置如下;

defaultSettings =     {
    AVFormatIDKey = 1768775988;
    AVLinearPCMBitDepthKey = 16;
    AVLinearPCMIsBigEndianKey = 0;
    AVLinearPCMIsFloatKey = 0;
    AVNumberOfChannelsKey = 2;
    AVSampleRateKey = 44100;
};

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM