-
Notifications
You must be signed in to change notification settings - Fork 185
Open
Description
Describe the bug
On iOS, an external audio stream (e.g., ringback tone via just_audio) is ducked/silenced when a LiveKit room connection is established. Playing a ring back tone is a crucial feature for any VoIP app.
To Reproduce
- Connect to the room
await room.connect(
llivekitURL,
livekitToken,
)
- Play ring back tone while waiting for the callee to join
Future<void> startRingbackTone() async {
try {
_audioPlayer ??= AudioPlayer();
await _audioPlayer!.setAsset('.../ringing.mp3');
await _audioPlayer!.setLoopMode(LoopMode.all);
await _audioPlayer!.play();
} catch (e) {
Log.error('RingbackTonePlayer: Failed to start ringback tone: $e');
}
}
- Then unable to hear the ring back tone since livekit connection ducking external audio (significantly reduced).
Expected behavior
The audio stream continues to play clearly alongside LiveKit audio.
Note that I’ve already tried configuring the WebRTC audio both before and after the LiveKit connection, but the issue persists.
if (Platform.isIOS) {
try {
await webrtc.Helper.setAppleAudioConfiguration(webrtc.AppleAudioConfiguration(
appleAudioCategory: webrtc.AppleAudioCategory.playAndRecord,
appleAudioCategoryOptions: {
webrtc.AppleAudioCategoryOption.mixWithOthers,
webrtc.AppleAudioCategoryOption.defaultToSpeaker,
webrtc.AppleAudioCategoryOption.allowBluetooth,
webrtc.AppleAudioCategoryOption.allowBluetoothA2DP,
},
appleAudioMode: webrtc.AppleAudioMode.videoChat,
));
Log.info('LiveKit: iOS audio configuration set for mixing with ringback tone');
} catch (e) {
Log.error('LiveKit: Failed to configure iOS audio session: $e');
}
}
Platform information
iOS 18.4.1
- Flutter version:
3.24.5 - Plugin version:
livekit_client: ^2.4.7 - Flutter target OS:
iPhone - iOS 18.4.1
^^ @cloudwebrtc
Metadata
Metadata
Assignees
Labels
No labels