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

Question: iOS 'Wide Spectrum' Flutter WebRTC equivalent? (Turn off noise filters) #761

Open
kNoAPP opened this issue Nov 10, 2021 · 9 comments

Comments

@kNoAPP
Copy link

kNoAPP commented Nov 10, 2021

Let's say I'd like to optimize the WebRTC call for musicians. I want the notes they play to sound as pure as possible when traversing the peer connection. In my testing, instruments don't sound great with this library. I believe there's some filtering going on before the audio is sent over the network. Is there a supported way I can turn off high-pass/low-pass filters, noise cancelation, echo cancelation, auto gain control, etc.?

I tried passing flags through mediaConstrainsts to shut these systems off, but it doesn't seem like they were effective.

@cloudwebrtc
Copy link
Member

cloudwebrtc commented Nov 11, 2021

I think it is technically feasible, but flutter-webrtc and libwebrtc need to be modified.

@cloudwebrtc
Copy link
Member

You can try these constraints, but I'm not sure whether flutter-webrtc handles these constraints

https://github.com/webrtc-sdk/webrtc/blob/main/sdk/media_constraints.cc#L96-L103

@kNoAPP
Copy link
Author

kNoAPP commented Nov 11, 2021

Thank you. I will give these flags a try and post an update.

@kNoAPP
Copy link
Author

kNoAPP commented Nov 11, 2021

I have tried these mandatory flags in Flutter WebRTC but did not notice any difference to the call:

      'echoCancellation': false,
      'googEchoCancellation': false,
      'googEchoCancellation2': false,
      'googDAEchoCancellation': false,
      'autoGainControl': false,
      'googAutoGainControl': false,
      'googAutoGainControl2': false,
      'noiseSuppression': false,
      'googNoiseSuppression': false,
      'googNoiseSuppression2': false,
      'googHighpassFilter': false,

So I'm guessing as you said, flutter-webrtc does not handle these constraints. Tested on Android and iOS.

@kNoAPP
Copy link
Author

kNoAPP commented Nov 11, 2021

How about bitrate for audio and video? Let's say I want that uncapped when possible? Can I negotiate this inside Flutter WebRTC, or will this require modification as well?

Edit: This has been solved and a reply is no longer needed.

@kNoAPP
Copy link
Author

kNoAPP commented Nov 17, 2021

@cloudwebrtc Are you open to financially sponsored feature requests?

@cloudwebrtc
Copy link
Member

@kNoAPP It would be awesome, I won’t be able to touch this code until next week, I’m crazy busy this week.

@cloudwebrtc
Copy link
Member

@kNoAPP I have made some changes to this branch. Android seems to be able to input music very well, without ns, aec, and high-pass filtering. For iOS, I have removed audio 3A, but because of the existence of the Audio Unit's hardware EC, the sound is still Is periodically suppressed by HW AEC, I am still trying, maybe need to modify libwebrtc.
https://github.com/flutter-webrtc/flutter-webrtc/tree/feat/support-unprocessed-audio

@cloudwebrtc
Copy link
Member

After waiting for this PR to merge, we can move forward
webrtc-sdk/webrtc#15

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