我正尝试使用以下设置对音频进行采样:
无论我的AVSampleRateKey多么小,音频的文件大小都不会低于83kb。我需要它在20kb到50kb的范围内。
我应该使用哪些设置? (这是一个10秒的文件)。
recordSetting = [NSMutableDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithFloat:4096.0],AVSampleRateKey,
[NSNumber numberWithInt:1],AVNumberOfChannelsKey,
[NSNumber numberWithInt:8],AVLinearPCMBitDepthKey,
[NSNumber numberWithInt:kAudioFormatLinearPCM],AVFormatIDKey,
[NSNumber numberWithBool:NO], AVLinearPCMIsFloatKey,
[NSNumber numberWithBool:0], AVLinearPCMIsBigEndianKey,
[NSNumber numberWithBool:NO], AVLinearPCMIsNonInterleaved,
[NSData data], AVChannelLayoutKey, nil];
AVAudioSession *audioSession = [AVAudioSession sharedInstance];
NSError *err = nil;
[audioSession setCategory :AVAudioSessionCategoryPlayAndRecord error:&err];
recorder = [[ AVAudioRecorder alloc] initWithURL:url settings:recordSetting error:&err];
[recorder setMeteringEnabled:YES];
[recorder recordForDuration:(NSTimeInterval) 10];
[recorder record];