簡體   English   中英

iOS中的錄音格式

[英]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。

多個iOS應用程序將Speex編碼器用於較低比特率的語音。 它不是內置的,但是可以使用開源代碼進行編碼。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM