fix!: Default audio output to system preferences#1563
Merged
Conversation
…behavior of Android
Collaborator
Author
|
@wujek-srujek @MichaelNZ85 @xxddff @LeoSandbox can you test this branch, if it solves your needs and if it still plays the sound through the speakers (and not the earpiece) by default? You can test this branch by copying this to pubspec.yaml: |
spydon
approved these changes
Jul 4, 2023
spydon
left a comment
Member
There was a problem hiding this comment.
Lgtm! I wonder how some of these defaults came into play to start with 😅
Collaborator
Author
|
@luanpotter do you have concerns about the changes? |
Member
I'll physically poke him, we're both at FlutterCon 😄 |
Collaborator
Author
|
Nice to hear, enjoy your stay 🥳 |
Member
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Supersedes #1501
AudioContextConfigRouteto allow forcing audio tospeakerorearpiece(this can be extended to e.g. bluetooth devices) for both iOS and Android.playAndRecordto.playbackto not play from earpiece as in record mode (see iOS volume very low (sound is coming from earpiece) #1194)AVAudioSessionOptions.defaultToSpeakerto allow playing from system default device instead of speaker only (see Sound does not play through headphones on Android and iOS devices #1486)truetofalseto allow playing from system default device instead of speaker only (see Sound does not play through headphones on Android and iOS devices #1486)AVAudioSessionOptions.mixWithOthersto interrupt audio of other apps, like in Androidtruetofalseto not stay awake, like in iOSWARNING: I could not test on a real device for iOS, all this is based on experiences of our community linked below!
Checklist
fix:,feat:,docs:,chore:etc).///, where necessary.Breaking Change
Migration instructions
AudioContextAndroid()AudioContextAndroid(isSpeakerphoneOn: true, stayAwake: true)AudioContextIOS()AudioContextIOS(category: AVAudioSessionCategory.playAndRecord, options: [AVAudioSessionOptions.mixWithOthers, AVAudioSessionOptions.defaultToSpeaker])AudioContextConfig()AudioContextConfig(route: AudioContextConfigRoute.speaker, stayAwake: true})Related Issues
Closes #1491
Closes #1486
#1194