测试

1.   60s  转换成mp3的文件大小 15 K,原文件大小 129K                            10s的原文件大小是 59K

NSMutableDictionary *recordSettings = [[NSMutableDictionary alloc] initWithCapacity:0];

    [recordSettings setValue :[NSNumber numberWithInt:kAudioFormatMPEG4AAC] forKey:AVFormatIDKey];//格式

    [recordSettings setValue:[NSNumber numberWithFloat:8000.0] forKey:AVSampleRateKey]; //采样8000

    [recordSettings setValue:[NSNumber numberWithInt: 1] forKey:AVNumberOfChannelsKey];//声道

    [recordSettings setValue :[NSNumber numberWithInt:8] forKey:AVLinearPCMBitDepthKey];//位深度

    [recordSettings setValue :[NSNumber numberWithBool:NO] forKey:AVLinearPCMIsBigEndianKey];

    [recordSettings setValue :[NSNumber numberWithBool:NO] forKey:AVLinearPCMIsFloatKey];

    //Encoder

    [recordSettings setValue :[NSNumber numberWithInt:12000] forKey:AVEncoderBitRateKey];//采样率

    [recordSettings setValue :[NSNumber numberWithInt:8] forKey:AVEncoderBitDepthHintKey];//位深度

    [recordSettings setValue :[NSNumber numberWithInt:8] forKey:AVEncoderBitRatePerChannelKey];//声道采样率

    [recordSettings setValue :AVAudioQualityMin           forKey:AVEncoderAudioQualityKey];//编码质量

你可能感兴趣的:(测试)