添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

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

Describe the bug
I have a use case that the app needs to play the background audio while being connected to the call.
It works fine when I use AudioMode.mono16K ( https://aws.github.io/amazon-chime-sdk-ios/Enums/AudioMode.html#/c:@M@AmazonChimeSDK@E@AudioMode@AudioModeMono16K ).

But when I try to use any other option like mono48K , stereo48K the background music is stopped.

This is how we setup the audioVideo and AVAudioSession :

let audioSession = AVAudioSession.sharedInstance()
if audioSession.category != .playAndRecord || !audioSession.categoryOptions.contains(.mixWithOthers) {
    try audioSession.setCategory(.playAndRecord, mode: .videoChat, options: [.mixWithOthers, .allowBluetoothA2DP])
let configuration = AudioVideoConfiguration(audioMode: .mono16K, callKitEnabled: false)
try session?.audioVideo.start(audioVideoConfiguration: configuration)

To Reproduce
Use the code snippet above to configure and start the call
Steps to reproduce the behavior:

  • Go to any app that is capable of playing the music in the background like Podcasts and play an audio
  • Go back to any app using Chime SDK and start call (audio video).
  • Observe that the background audio is stopped
  • Expected behavior
    The background audio is not stopped like in case of the mono16K audio mode for other modes.

    I compared the DEBUG logs while using mono16K and other modes but nothing was really different in the logs.

    Screenshots

    Test environment Info (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: iOS 15.7 and iOS 16.1.1
  • Version AmazonChimeSDK: [e.g. v0.22.4]
  • Version AmazonChimeSDKMedia: [e.g. v0.22.4]
  • Can you reproduce this in the demo app?
    Didn't try
  • Additional context

    Hi @nonameplum Could you try integrating with CallKit and see if you still run into this issue?
    Here is a reference on how to do that: https://aws.amazon.com/blogs/business-productivity/how-to-integrate-apples-callkit-into-ios-applications-using-the-amazon-chime-sdk/

    to include the mixWithOthers option, e.g.:

    try audioSession.setCategory(.playAndRecord, mode: .videoChat, options: [.mixWithOthers, .allowBluetoothA2DP])

    Then if you start some music in the background and try to join to the meeting while using the mono16K you will be able to hear the background music still playing with "worse" quality, but still.

    If you will pick any other option like stereo48K when you will try to join meeting the background music will stop playing.