-
Notifications
You must be signed in to change notification settings - Fork 365
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
iOS randomly chooses speaker and earpiece #862
Comments
I might have found the solution by doing something like this in flutter: Future<AudioSession> startAudioSession(bool microphone) async {
var session = await AudioSession.instance;
if (microphone) {
await session.configure(const AudioSessionConfiguration.music().copyWith(
avAudioSessionCategory: AVAudioSessionCategory.playAndRecord,
avAudioSessionMode: AVAudioSessionMode.measurement));
} else {
await session.configure(const AudioSessionConfiguration.music().copyWith(
avAudioSessionCategory: AVAudioSessionCategory.playback,
avAudioSessionCategoryOptions: AVAudioSessionCategoryOptions.defaultToSpeaker &
AVAudioSessionCategoryOptions.allowBluetooth &
AVAudioSessionCategoryOptions.allowBluetoothA2dp &
AVAudioSessionCategoryOptions.allowAirPlay &
AVAudioSessionCategoryOptions.mixWithOthers,
avAudioSessionMode: AVAudioSessionMode.measurement,
));
}
await session.setActive(true);
return session;
} |
Can you provide some details? I am facing some issues with iOS. AudioSession is something from flutter? |
Audio Session is a flutter pacakge, it can manage your iOS AVAudioSession. It seems like cpal fails to do so (I don't know if by design or not?), and you have to configure and start the audio session yourself. Maybe coreaudio-sys / coreaudio-rs could help. I think this is only an issue since iOS 17 |
Hi there,
after somewhat mitigating another ios issue (#842), I am still having trouble with the audio devices.
Whenever I open an audio output stream:
the iPhone seemingly randomly chooses between the built in earpiece and speaker. It isn't related to me holding it to my ear.
Is there a way to choose? I am only getting one audio output device ("Default Device") on the host...
The text was updated successfully, but these errors were encountered: