搜索
ios - 音频用什么压缩格式
迷茫
迷茫 2017-04-17 11:10:48
[iOS讨论组]

微信,陌陌那种语音聊天,一般音频用什么压缩格式

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

全部回复(4)
PHP中文网

我的设置给你参考下,m4a格式,音质可以说算好了,20秒40k,2秒也是40k,更长时间忘了多大了,反正比上传图片流量小很多

NSMutableDictionary* recordSetting = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                              [NSNumber numberWithInt:kAudioFormatMPEG4AAC], AVFormatIDKey,
                                              [NSNumber numberWithFloat:44100.0], AVSampleRateKey,
                                              [NSNumber numberWithInt:1], AVNumberOfChannelsKey,
                                              [NSNumber numberWithInt:AVAudioQualityMin], AVEncoderAudioQualityKey,
                                              [NSNumber numberWithInt:AVAudioQualityMin], AVSampleRateConverterAudioQualityKey,
                                              [NSNumber numberWithInt:8], AVLinearPCMBitDepthKey,
                                              nil];
PHP中文网

应该说这种聊天选择占用内存最小的格式吧,涉及到上传。我没有ios微信,不过我猜测,把后缀名改为caf应该可以打开,caf基本上相当于一个万能的容器,几乎什么格式都能放进去。

小生以ios为例,AVAudioRecorder录制的最小格式应该为这种参数:

[NSNumber numberWithFloat: 16000.0],AVSampleRateKey,
[NSNumber numberWithInt: kAudioFormatMPEG4AAC],AVFormatIDKey,
[NSNumber numberWithInt: 1],AVNumberOfChannelsKey,
伊谢尔伦

1. 米聊听说是iphone和android都是客户端用speex,压缩。尺寸应该很小,60s在20K左右
2. 微信听说是AMR,没测试,可以抓包看看。
3. 陌陌听说是wav,文件大了去了

我最近在做的一个即时通信app,客户端只录音,没有对语音处理,服务端处理各种,例如降噪等。
iOS的录音设置:

NSDictionary *settings = [NSDictionary dictionaryWithObjectsAndKeys:
                              [NSNumber numberWithFloat:8000],                  AVSampleRateKey, // 电话所用采样率
                              [NSNumber numberWithInt:kAudioFormatMPEG4AAC],    AVFormatIDKey,
                              [NSNumber numberWithInt:1],                       AVNumberOfChannelsKey,
                              [NSNumber numberWithInt:16],                      AVLinearPCMBitDepthKey,
                              [NSNumber numberWithInt:AVAudioQualityMin],       AVEncoderAudioQualityKey,
                              nil];
PHP中文网

微信ios用的是无法打开的aud格式,各种工具都无效。
微信安卓用的貌似是amr格式。

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号