react-native-vision-camera icon indicating copy to clipboard operation
react-native-vision-camera copied to clipboard

✨ More Customized Audio Control

Open ChristopherGabba opened this issue 1 year ago • 1 comments

What feature or enhancement are you suggesting?

My application is somewhat similar to FaceTime in the fact that the user may play videos while the front camera is recording the user. Right now I'm using react-native-video that allows some level of flexibility, with props like

  • mixWithOthers
  • audioOutput
  • etc.

I'm using react-native-vision-camera and right now I believe the AVAudioSessionCategory is just playAndRecord (but I'm not positive on this).

One of the issues that I'm experiencing is that if a user is playing a video, the audio from the video is getting picked up by the microphone, which can sound poor or reduce the users microphone input. This is obviously a very difficult technical challenge to solve. I've been trying tons of different combinations and even trying to set the AudioSession separately with react-native-volume-manager.

I don't know how possible this is, but some things that come to mind for some new react-native-vision-camera properties:

  • microphoneSensitivity // 0 - 100 percent
  • audioSessionCategory // similar to setCategory
  • audioSessionMode // similar to setMode
  • disableAudioSession // somehow allow the user to set their own audio session using libraries like react-native-volume-manager
  • microphoneSelection // maybe there is more than one microphone for a specific device and the user can select?
  • removeBackgroundNoise // some insane method that filters background audio (I saw this on a new google pixel advertisement)

Expo Audio has some decent features for audio control.

I don't quite know the best way to approach this issue in my ignorance. I guess the perfect test would be to have demo video playing with react-native-video on decent (60-80%?) volume and the front camera not picking up any of the music or video audio.

Thanks as always @mrousavy, Chris

What Platforms whould this feature/enhancement affect?

iOS, Android

Alternatives/Workarounds

I've tried tons and tons of customizations and combinations with different audio levels.

The only way the camera doesn't pick up background audio from the video is if the user is wearing headphones or if the video is at a very low volume.

Additional information

ChristopherGabba avatar Feb 17 '24 15:02 ChristopherGabba

Just noticed that there is a static background noise while recording videos using this library. Compared with the iphone camera app, there doesn't seem to be any background noise.

prasan2421 avatar Mar 24 '24 21:03 prasan2421