8000 add support for lightning microphone by cr0manty · Pull Request #693 · flutter-webrtc/flutter-webrtc · GitHub
[go: up one dir, main page]

Skip to content

add support for lightning microphone #693

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

Merged
merged 1 commit into from
Sep 22, 2021

Conversation

cr0manty
Copy link
Contributor

the problem was with webrtc forcing the AVAudioSessionCategoryPlayAndRecord which overrides the microphone to use the built-in

added force replacement of the category with AVAudioSessionCategoryPlayAndRecord, so that the external microphone can be detected

@cloudwebrtc
Copy link
Member

LGTM

@cloudwebrtc cloudwebrtc merged commit ee6ee59 into flutter-webrtc:master Sep 22, 2021
@davidzhao
Copy link
Member

I have an issue with the way this PR works:

  1. as a framework SDK, it's really, really dangerous to override the desired audio category changes performed elsewhere in the app. this will introduce quite a bit of unintended behaviors for users of this library, LiveKit included.
  2. AVAudioSessionCategoryMultiRoute may break bluetooth devices and airplay for outputs, according to docs
  3. making usb mic input work is really an artifact of AVAudioSessionCategoryMultiRoute. according to the docs here, there are other ways of switching audio input without forcing this category on all users of the library.

Because of the above, I strongly recommend reverting this.

@cloudwebrtc
Copy link
Member
cloudwebrtc commented Sep 28, 2021

It makes sense. If we can the lightning microphone and the issue in webrtc-sdk/webrtc#7 (comment) same time, I will revert this PR.

@hiroshihorie
Copy link
Member

@cr0manty I recommend you manage audio session at your app level using https://pub.dev/packages/audio_session for example. 😁
Modifications to audio session at flutter_webrtc level will cause many unintended issues since it's impossible to cover all user's use cases. 😁

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.

4 participants
0