RenderHeads / UnityPlugin-AVProMovieCapture

AVPro Movie Capture is a Unity Plugin for advanced video capture to AVI/MP4/MOV files
https://renderheads.com/products/avpro-movie-capture/
43 stars 8 forks source link

[Question] Adding an audio delay when using AudioCaptureSource.Microphone #393

Closed artoonie closed 1 month ago

artoonie commented 1 month ago

AVPro Movie Capture Version

5.2.4

Which platform is your question for?

No response

Your question

I want to add a 2 second audio delay to the recorded video on iOS.

I built a prototype using AudioCaptureSource.Manual and Unity's Microphone class, but Unity's Microphone.Start has a bug where you cannot listen to music in the background while using it.

Using AVProMovieCapture's AudioCaptureSource.Microphone does not have this bug.

I have submitted a bug report to Unity, but I'm not confident it will be addressed anytime soon.

I believe my only option is to reimplement Unity's Microphone class from scratch, and avoiding whatever they did that causes external audio to pause. Before I embark on that journey, I wanted to post a question here to see if there's any way of adding a manual, 0-2 second delay when using AudioCaptureSource.Microphone.

artoonie commented 1 month ago

I have reimplemented Unity's Microphone class, but there is an additional Unity bug: UnitySetAudioSessionActive pauses externally-playing audio, and without calling it, Unity audio doesn't play.

I have opened bug report IN-77137 with Unity, but for now, I don't think there's anything AVProMovieCapture can do to work around this issue.