1.下载对应的语音包
2.speex压缩:
- (void)inputPCMDataFromBuffer:(Byte *)buffer size:(UInt32)dataSize {
int packetSize = FRAME_SIZE * 2;
NSMutableArray *pcmDatas = [NSMutableArray array];
NSMutableData *tempData = [NSMutableData data];
[tempData appendBytes:buffer length:dataSize];
while ([tempData length] >= packetSize) {
@autoreleasepool {
NSData *pcmData = [NSData dataWithBytes:[tempData bytes] length:packetSize];
[pcmDatas addObject:pcmData];