UIImagePickerController AVAudioPlayer [英] UIImagePickerController AVAudioPlayer

查看:83
本文介绍了UIImagePickerController AVAudioPlayer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我打开 UIImagePickerController 时,我可以显示设备的相机输入流。

When I open a UIImagePickerController, I can display the device's camera input stream.

但是当我玩的时候一个 AVAudioPlayer [玩家玩] 然后相机停止工作。

But when I play an AVAudioPlayer with [player play] then the camera stops working.

我该如何处理?

推荐答案

你不能因为UIIMagePickerController正在控制音频,你需要使用低级AVFoundation来做到这一点。

you can't because UIIMagePickerController is controlling the audio, you will need to use low level AVFoundation in order to do that.

checkout AVCam 示例代码如何录制电影并将视图添加为子视图,这样您将保持对音频的控制并能够播放音频。

checkout AVCam sample code how to record a movie and add the view as subview , that way you will stay in control of the audio and will be able to play audio.

这篇关于UIImagePickerController AVAudioPlayer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆