margelo / margelo/react-native-vision-camera

✨ More Customized Audio Control

Open
#2,581 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

✨ feature
Dominant language
TypeScript
Stars
9.6k
Forks
1.4k
Avg merge
1d 28m
Merged PRs (30d)
4

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Verify how react-native-vision-camera currently configures AVAudioSessionCategory playAndRecord on iOS and how its Android audio path interacts with react-native-video. Compare the requested audio session, microphone, and noise-control options with the existing APIs, then define a reproducible test using video playback and front-camera recording on both platforms.

Written by the indexing model from the issue text.

Assessment

Tech stack
react-native, typescript
Domain
audio-video-rtc, mobile-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.