mrousavy / react-native-vision-camera

📸 A powerful, high-performance React Native Camera library.
https://react-native-vision-camera.com
MIT License
7.3k stars 1.07k forks source link

✨ More Customized Audio Control #2581

Open ChristopherGabba opened 7 months ago

ChristopherGabba commented 7 months ago

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

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:

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

prasan2421 commented 5 months ago

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.