2010-05-18 5 views
0

aac 형식으로 AVAudioRecorder를 초기화하고 싶습니다. 이렇게하려면 다음 코드를 사용합니다.iphone sdk : AVAudioRecorder의 초기화가 nil을 반환합니다.

soundFilePath = [soundFilePath stringByAppendingPathExtension:@"aac"];NSURL *url = 
[NSURL fileURLWithPath:soundFilePath isDirectory:FALSE]; 

NSMutableDictionary *recordSetting = [[NSMutableDictionary alloc] init]; 
[recordSetting setValue:[NSNumber numberWithInt: 'aac '] forKey:AVFormatIDKey];          
[recordSetting setValue:[NSNumber numberWithInt:AVAudioQualityMin] forKey:AVEncoderAudioQualityKey];    //Encoder Settings 
[recordSetting setValue:[NSNumber numberWithInt:AVAudioQualityMin] forKey:AVSampleRateConverterAudioQualityKey]; //Sample Rate Conversion Settings 

_recorder = [[AVAudioRecorder alloc] initWithURL:url settings:recordSetting error:nil]; 

왜이 기능이 작동하지 않습니까? 이아를 ima4로 바꾸면 이드가 작동합니다!

답변

0

'aac'은 미리 정의 된 형식 ID가 아니므로 작동하지 않습니다. U는이 모든 목록을 얻기 위해 지원되는 audiotype 상수를 볼 수 있습니다. 그들은 사용할 수 있습니다 here

상수 secion에서.

관련 문제