2010-07-07 87 views
2

在iPhone音頻錄製中我應考慮哪種音頻錄製格式,因爲下一步是將音頻錄製格式轉換爲WAV。因此,請指導我哪些音頻錄製格式在iPhone有庫轉換成WAV格式?哪些錄音格式在iPhone?

謝謝。

回答

2

AVAudioRecorder使音頻錄製比以前的SDK版本更簡單。您可以在錄製之前配置它以滿足您的需求。

下面的設置應該將其配置爲WAV文件:

NSMutableDictionary* recordSetting = [[NSMutableDictionary alloc] init]; 
    [recordSetting setValue :[NSNumber numberWithInt:kAudioFormatLinearPCM] forKey:AVFormatIDKey]; 
    [recordSetting setValue:[NSNumber numberWithFloat:44100.0] forKey:AVSampleRateKey]; 
    [recordSetting setValue:[NSNumber numberWithInt: 2] forKey:AVNumberOfChannelsKey]; 

而這在初始化過程中使用的是刻錄機:

recorder = [[ AVAudioRecorder alloc] initWithURL:fileURL settings:recordSetting error:&error];