注册

iOS 收到语音消息fileURLPath 怎么播放?

iOS 收到语音消息fileURLPath 怎么播放?
- (BOOL)convertAMR:(NSString *)amrFilePath toWAV:(NSString *)wavFilePath;
这个方法的第一个参数是传 AMR 文件?还是直接传fileURLPath?
已邀请:
// play the audio
if (model.bodyType == EMMessageBodyTypeVoice) {
//send the acknowledgement
[self _sendHasReadResponseForMessages:@[model.message] isRead:YES];
__weak EaseMessageViewController *weakSelf = self;
BOOL isPrepare = [[EaseMessageReadManager defaultManager] prepareMessageAudioModel:model updateViewCompletion:^(EaseMessageModel *prevAudioModel, EaseMessageModel *currentAudioModel) {
if (prevAudioModel || currentAudioModel) {
[weakSelf.tableView reloadData];
}
}];

if (isPrepare) {
_isPlayingAudio = YES;
__weak EaseMessageViewController *weakSelf = self;
[[EMCDDeviceManager sharedInstance] enableProximitySensor];
[[EMCDDeviceManager sharedInstance] asyncPlayingWithPath:model.fileLocalPath completion:^(NSError *error) {
[[EaseMessageReadManager defaultManager] stopMessageAudioModel];
dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf.tableView reloadData];
weakSelf.isPlayingAudio = NO;
[[EMCDDeviceManager sharedInstance] disableProximitySensor];
});
}];
}
else{
_isPlayingAudio = NO;
}

要回复问题请先登录注册