首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何转换AVAssetExportSession的响应

如何转换AVAssetExportSession的响应
EN

Stack Overflow用户
提问于 2015-02-02 07:17:09
回答 1查看 294关注 0票数 1

我正在使用AVAssetExportSession进行音频记录和断言,这里是我的代码,以将AVAssert转换为AVAssertExportSession。

代码语言:javascript
复制
AVAssetExportSession *exportSession = [AVAssetExportSession exportSessionWithAsset:self.asset presetName:AVAssetExportPresetAppleM4A];
exportSession.outputURL = [NSURL URLWithString:dataPath];
exportSession.outputFileType = AVFileTypeAppleM4A;
exportSession.shouldOptimizeForNetworkUse = YES;
[exportSession exportAsynchronouslyWithCompletionHandler:^{
    NSLog(@".... Audio... %@",exportSession);
}];

它给了我这样的输出

代码语言:javascript
复制
<AVAssetExportSession: 0x177f4b30, asset = <AVURLAsset: 0x18981f60, URL = file:///private/var/mobile/Containers/Data/Application/8BB39AD5-EEFB-4AF1-A913-B26C5C072E61/tmp/1422861622SCVideo.0.m4a>, presetName = AVAssetExportPresetAppleM4A, outputFileType = com.apple.m4a-audio

这里我只想要NSString的网址。

帮我个忙

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-02-02 09:15:08

导出会话完成后,您可以得到所需的内容。因为它是一个异步操作。

代码语言:javascript
复制
[exportSession exportAsynchronouslyWithCompletionHandler:^{
        if (exportSession.status == AVAssetExportSessionStatusFailed) {
            NSLog(@"failed");
        } else if(exportSession.status == AVAssetExportSessionStatusCompleted){
            NSLog(@"completed!");
            // here you can get the output url.
        }
    }];
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/28272748

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档