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

feat: support unprocessed audio #825

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

cloudwebrtc
Copy link
Member

@cloudwebrtc cloudwebrtc commented Dec 30, 2021

Supports unprocessed audio input, such as midi, singing, musical instruments. or specific sound sources.
Keep the original sound quality as much as possible.

@cloudwebrtc cloudwebrtc marked this pull request as ready for review January 10, 2022 13:50
@cloudwebrtc
Copy link
Member Author

cloudwebrtc commented Jan 10, 2022

@kNoAPP hey, you can use this branch for testing (review ready), I added bypassVoiceProcessing for plugin initialize, in the loopback sample you can turn off audio 3A,


  void initRenderers() async {
    await WebRTC.initialize(options: {'bypassVoiceProcessing': true});
    await _localRenderer.initialize();
    ...
  }

  void _makeCall() async {
 
    final String AUDIO_ECHO_CANCELLATION_CONSTRAINT = 'googEchoCancellation';
    final String AUDIO_AUTO_GAIN_CONTROL_CONSTRAINT = 'googAutoGainControl';
    final String AUDIO_HIGH_PASS_FILTER_CONSTRAINT = 'googHighpassFilter';
    final String AUDIO_NOISE_SUPPRESSION_CONSTRAINT = 'googNoiseSuppression';

    final mediaConstraints = <String, dynamic>{
      'audio': {
        'mandatory': {
          AUDIO_ECHO_CANCELLATION_CONSTRAINT: false,
          AUDIO_AUTO_GAIN_CONTROL_CONSTRAINT: false,
          AUDIO_HIGH_PASS_FILTER_CONSTRAINT: false,
          AUDIO_NOISE_SUPPRESSION_CONSTRAINT: false,
        }
      },
      'video': {
        'mandatory': {
          'minWidth':
              '640', // Provide your own width, height and frame rate here
          'minHeight': '480',
          'minFrameRate': '30',
        },
        'facingMode': 'user',
        'optional': [],
      }
    };

@kNoAPP
Copy link

kNoAPP commented Jan 10, 2022

Great news! I will give it a test this week and get back to you.

@kNoAPP
Copy link

kNoAPP commented Jan 12, 2022

Testing blocked by webrtc-sdk/webrtc#16. I will resume when possible.

@kNoAPP
Copy link

kNoAPP commented Jan 14, 2022

@cloudwebrtc The changes for iOS & Android sound really good! There's a definite improvement to the instrument audio coming through. A few things found in testing:

  1. The unprocessed audio mode is not toggleable. Once its set, you can't change it.
  2. There's no change on MacOS. The audio is still being filtered here.

If possible, can these be fixed before merging?

@cloudwebrtc
Copy link
Member Author

I looked at the audio I/O section of macOS and it seems to be quite different from iOS. still need some time to try to figure it out.

@jrmilholland
Copy link

@cloudwebrtc - We took over the project from kNoAPP, any update about MacOS?
Also, we ran into an issue on iOS when bypassVoiceProcessing = true, when sending data, the receiver hears their own voice (this doesn't happen when bypassVoiceProcessing = false), any thoughts?
Thanks

@cloudwebrtc
Copy link
Member Author

hey, @jrmilholland, I've had a very busy 2+ months, but I'll have time to work on these issues over the next week.
This may be due to the fact that the device does not handle automatic gain and echo suppression after enabling bypassVoiceProcessing (however, the mic acquisition gain of iOS is very sensitive), so you need to try connecting wired headphones or monitoring headphones to avoid the sound returning to the microphone.

@upta
Copy link

upta commented Apr 5, 2022

Hey @cloudwebrtc,

Our client has some additional work he’d like to discuss with you if that’s something you might be interested in.

Would you be open to scheduling an audio/video chat? We are in the Pacific time zone but could work with whatever works best for you.

I sent you an email as well, but I figured I'd try here as well just in case that lands in a spam filter or something.

Thanks!

@cloudwebrtc
Copy link
Member Author

I'll try to add unprocessed-audio support to macOS this week.

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

Successfully merging this pull request may close these issues.

None yet

4 participants