Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with multiple AudioSources being cut off in final video output. #11

Open
spiff-liam opened this issue Dec 20, 2017 · 4 comments
Open

Comments

@spiff-liam
Copy link

We've got an issue with the output of our audio files with scene and mic audio streams.

We're placing a video in our scene and allowing the user to record the video playing in AR. The output video from iVidCap has weird behaviour with audio. When the AR video starts playing our microphone audio cuts out. There's also issues with scratchiness and choppiness of the microphone randomly.

Any ideas on what could be going wrong here?

@ThisNetWorks
Copy link
Collaborator

Hi, that sounds unusual.

I do a very similar process, though with an ordinary video, rather than AR, in a number of our apps with no dificulty.

How is the AR video played? and what format of video is it? I now tend to use the UnityVideoPlayer, but prior to that becoming available have used a variety of plugins.

What audiosource does the AR video play to?

My general technique for this has been to attach the audiosource of the video to the same source that iVidCapAudio is on.

You say you're using multiple audiosources. can you explain further?

@spiff-liam
Copy link
Author

We're running Unity 2017.1.1f

We're using easy movie texture for video playback. The generated file is a .mov file.

The audio source of the AR video is on a different object to ividcapaudio. I'll go ahead and force the movie plugin to build it there and see what the results are.

We are using multiple sources. We have a UI audio source, the movie plugins audio source and the audio source listening to the microphone as well. Each audio source is in a different area of the hierarchy

@oschvr
Copy link

oschvr commented Apr 27, 2018

I'm doing the same thing as @spiff-liam and found that when Microphone.Start() is called, Unity will switch the audio output from the speaker to the earpiece speaker. This results in the "recording" phase becoming quiet of a sudden. I've found a way to force the speaker in this repository: UnitySpeakerFix

I actually got it working, but now, I'm getting a horrible reverberation since the mic output and the audio from the scene gets fed into the mic.

Is there a way to do Captureaudio.Mic (Only capture from mic)

I've studied Snapchat and they only process the mic input.

Thanks !

@ThisNetWorks
Copy link
Collaborator

Yes, you will get a reverb if Unity is playing out the speaker, and you're recording from the mic as well. The only way to resolve that reverb (if I'm understanding what you require correctly), is to stop playing audio out the speaker.

There are a couple of other ways to do what you maybe trying to do, it depends on what you want to achieve.

I have one solution where I playback a video through unity, allow audio to play normally, don't capture it at all with iVidCapPro during that playback, and afterwards use the video audio track, to mix in the with iVidCapPro recording.

I have another where I playback video through unity, allow the audio track to play, but not capture the audio track through to iVidCapPro, but do capture other audiosources in Unity (so you get any sound effects that you're playing in Unity while the video is playing back), through to iVidCapPro, and then mix the unity supplied audio track with the video supplied audio track, after recording is completed.

Do either of those two sound like what you're wanting to achieve?

If so I can send you the objective c code to tweak that in - it mostly needs to be done at an iOS level

There are some other options for capturing mic input at an iOS level, but you'll end up with the same reverb if you're playing back audio from unity at the same time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants