#StackBounty: #swift #agora.io Mixing Audio without ducking audio

Bounty: 50

I’m trying to mix audio sources such that there is no audio ducking. I’m using Agora, and the use case I’m trying to solve is having an audio call ongoing in the background while also playing music and/or listening to app audio, without any audio ducking. Audio ducking is when the audio is lowered and distorted slightly to help with the listening of another audio session. Can I have unducked audio and audio mixing with Agora (or iOS for that matter)?

I have tried the following code after beginning an Agora audio session. I have also tried wrapping it in a DispatchQueue.main.async closure, but still no luck.


// I have also tried this code with this block uncommented
// do {
//     try audioSession.setActive(false, options: .notifyOthersOnDeactivation)
//
// } catch let activationError {
//     print(activationError)
//     print(activationError.localizedDescription)
// }


let audioSession = AVAudioSession.sharedInstance()
do {
    try audioSession.setCategory(
        AVAudioSession.Category.playAndRecord,
        mode: AVAudioSession.Mode.voiceChat,
        options: [.allowBluetoothA2DP, .allowBluetooth, .mixWithOthers, .allowAirPlay]
    )
} catch let setCategoryError {
    print(setCategoryError)
    print(setCategoryError.localizedDescription)
}

do {
    try audioSession.setActive(true, options: .notifyOthersOnDeactivation)

} catch let activationError {
    print(activationError)
    print(activationError.localizedDescription)
}


Get this bounty!!!

#StackBounty: #objective-c #react-native #agora.io Mute iOS microphone input with ReactNative

Bounty: 50

I am using Agora’s ReactNative library for a group calling project, I need the user to be able to mute/unmute his phone microphone. Currently there is only a function to muteLocalAudioStream which does mute the whole stream, that includes the background sounds, as the streamer can add background sound to the call.

For Android I managed to mute/unmute the microphone with the below hack:

@ReactMethod
    public void muteMic(){
        AudioManager audioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
        audioManager.setMode(AudioManager.MODE_IN_CALL);
        if (audioManager.isMicrophoneMute() == false) {
            audioManager.setMicrophoneMute(true);

        } else {
            audioManager.setMicrophoneMute(false);
        }
    }

However, I couldn’t do it for iOS, I appreciate your help on this.


Get this bounty!!!