【发布时间】:2017-11-24 14:41:34
【问题描述】:
我计划在我的 iOS 应用中重构我的录音系统。 语境: 到目前为止,我分别录制视频和音频,几乎同时开始录制。录制完成后,在同一系统中,我分别播放视频和音频,并在音频上动态应用 AudioUnits。最后,我合并了视频和修改后的音频。 碰巧两条记录不会同时开始(出于任何原因),从而产生不同步的结果。
是否可以像这样重构我的系统:
1) Record normal video with audio into mov file --> I would be sure that audio+video would be synchronized.
2) During viewing the result with AVPlayer, process the audio part on the fly. (I will use AudioKit) --> that's the part I m not confident.
Would I be able to send the audio buffer to Audiokit (which would process it) and give back the processed audio to AVPlayer like if it was the original AVPlayer audio part?
3) Save a final file with video and audio modified --> easy part with AVFundation
请询问任何信息;)
【问题讨论】:
-
只是为了确保您正在录制视频,但想要更改音频样本?如果是这样,您可以将 AVCaptureVideoDataOutput 与 AVCaptureAudioDataOutput 一起使用,这将为您提供 CMSample 的音频,您可以将其放入同步队列中的任何进程,该进程将通过 AVAssetWriter 输出
-
差不多就是这样。录制后需要进行音频处理,因为用户会选择将哪种音频效果应用于最终视频。拥有与 AVCaptureAudioDataOutput 等效但在 AVPlayer 级别会很酷(Audiokit 确实提供此功能,但不支持视频)
-
我认为你可以使用 AVAssetReader,它也会输出已记录文件的样本
-
好的,谢谢。下周我将深入探讨这个问题,跟进第一个线索。我会回来询问更多和/或发布我的工作。
标签: ios video avplayer audiounit audiokit