开发者

AVassetExportSession kills my audio

when I start –exportAsynchronouslyWithCompletionHandler: method of AVassetExportSession my audio is stops playing. I am using AudioQueue and OpenAL they both needs to be restarted after beginning expor开发者_StackOverflow社区t session. Is there any trick to make them work without restarting audios?


Well. Nobody has answered to me, so I will answer myself. Figured that when exporting with AVAssetExportSession it creates its own audio queue therefore it kills my, so before starting my queue all I need is to set some properties to AudioSession.

AudioSessionInitialize(CFRunLoopGetCurrent(), 
                             kCFRunLoopCommonModes, 
                             NULL, 
                             NULL);
AudioSessionSetProperty(kAudioSessionProperty_AudioCategory, 
                              sizeof(kAudioSessionCategory_MediaPlayback), 
                              &(int) 
                              {kAudioSessionCategory_MediaPlayback});
AudioSessionSetProperty(kAudioSessionProperty_OverrideCategoryMixWithOthers, 
                              sizeof (UInt32), 
                              &(UInt32) 
                              {1});
AudioSessionSetActive(YES);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜