测试

来源:互联网 发布:神奇公式优化 编辑:程序博客网 时间:2024/05/21 09:17
1.   60s  转换成mp3的文件大小 15 K,原文件大小 129K                            10s的原文件大小是 59K

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

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

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

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

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

    [recordSettings setValue :[NSNumbernumberWithBool:NO]forKey:AVLinearPCMIsBigEndianKey];

    [recordSettings setValue :[NSNumbernumberWithBool:NO] forKey:AVLinearPCMIsFloatKey];

    //Encoder

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

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

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

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

原创粉丝点击