ios - Is it possible to record audio and play video from network stream at the same time?
I'm doing research for a iPhone video chat app project.
I've tried this t开发者_如何学编程o capture image,
useAVCaptureVideoPreviewLayer
to display camera view
and put a MPMoviePlayerController
to play network stream video at the back.
They all work until I add an audio input to the AVCaptureSession
.
MPMoviePlayerController
stop the AVCaptureSession
if there is audio input.
I think of using AVAudioSession
for both playing and recording audio and some other way to play video,
but the documentation of AVAudioPlayer
said
"Apple recommends that you use this class for audio playback unless you are playing audio captured from a network stream or require very low I/O latency."
I found the Multimedia Programming Guide saying that
"To provide lowest latency audio, especially when doing simultaneous input and output (such as for a VoIP application), use the I/O unit or the Voice Processing I/O unit."
Is it the correct direction to implement video chat in iphone?
精彩评论