[英]Audio recording formats in ios
哪種音頻格式的ios語音記錄尺寸較小? 質量不一定是最好的,而是用戶可以理解的。
假設您打算使用AVAudioRecorder
類,則應提供如下錄音設置-
NSDictionary *recordSettings = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:AVAudioQualityMin], AVEncoderAudioQualityKey,
[NSNumber numberWithInt:16], AVEncoderBitRateKey,
[NSNumber numberWithInt: 2],AVNumberOfChannelsKey,
[NSNumber numberWithFloat:44100.0], AVSampleRateKey,nil];
NSError* error = nil;
AVAudioRecorder audioRecorder = [[AVAudioRecorder alloc]
initWithURL:soundFileURL
settings:recordSettings
error:&error];
Apple的文檔提供了有關可在應用程序中使用的設置常量(特別是AVEncoderAudioQualityKey
)的詳細信息。
在相同的位深度下,單聲道22.05KHz足以滿足語音要求,是立體聲44.1KHz大小的1/4。 您甚至可能嘗試將其降低到11.025KHz。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.