Volume of background application gets super low when in meeting

Description
We are using showMinimizeMeetingFromZoomUIMeeting on the iOS SDK and when minimized the user can play video clips.
But the volume of the video clips is really low no matter the system volume . As soon as Zoom meeting is closed the volume in the background clips get to the actual state. How can we get the same volume as expected while in a meeting (even with audio disconnected mode)

Which iOS Client SDK version?
v5.4.54802.0124

Smartphone (please complete the following information):
We have tested this on iPhone 11, 12, XR , iPad Air 2020. And its the same in all devices.

Hey @chamathpali,

Thanks for using the dev forum!

Hmm that is strange, I have not heard of this issue before. Can you update to the latest version of the SDK and let me know if you see the same behavior?

Thanks!
Michael

hi @Michael_Condon Yes this is a major issue for us since it completely make the volume of our app to like 10% or even lower no matter how hight the system sound is.
we have the app on the store right now i can share you a test credentials if you can have a look?

Hey @chamathpali,

We try to avoid receiving confidential information like that unless absolutely necessary. Are you able to update to the latest SDK version?

Thanks!
Michael

Yes i can confirm that the latest SDK (5.5.12511.0421 ) has the same issue.

I used the sample project in the SDK zip file and re-created the issue by doing the following

Add the following audio player in the - (void)viewDidLoad method in MainViewController.m

    NSString *soundFilePath = [NSString stringWithFormat:@"%@/test.m4a",[[NSBundle mainBundle] resourcePath]];
    NSURL *soundFileURL = [NSURL fileURLWithPath:soundFilePath];

    AVAudioPlayer *player = [[AVAudioPlayer alloc] initWithContentsOfURL:soundFileURL error:nil];
    player.numberOfLoops = -1; 

    [player play];

Make sure you add a test m4a file to resources and import

#import <AudioToolbox/AudioToolbox.h>
#import <AVFoundation/AVFoundation.h>

After that try to join a meeting while the audio is playing in the background. the volume of the audio will go super low as soon as the meeting window opens.

Hey @chamathpali,

Thank you for providing clear reproduction steps and utilizing the sample application, that makes our life so much easier! :slight_smile:

I was able to reproduce what you are seeing. It looks like the root cause of this issue is that once the meeting is joined, the shared audio session will be set to playAndRecord. This will automatically drop the volume of other audio sources. If you check the audio category imediately after calling your code^ in the mainViewController you will see that it is soloAmbient.

    NSString *soundFilePath = [NSString stringWithFormat:@"%@/test.m4a",[[NSBundle mainBundle] resourcePath]];
    NSURL *soundFileURL = [NSURL fileURLWithPath:soundFilePath];

    AVAudioPlayer *player = [[AVAudioPlayer alloc] initWithContentsOfURL:soundFileURL error:nil];
    player.numberOfLoops = -1;
    AVAudioSessionCategory category = [[AVAudioSession sharedInstance] category];
    NSLog(category);
    [player play];

I found this post on stack overflow of how to override the dropping of other audio’s volume while keeping the the category as playAndRecord:

So by adding this code:

NSError *setCategoryErr = nil;
NSError *activationErr  = nil;
//Set the general audio session category
[[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryPlayAndRecord error: &setCategoryErr];

//Make the default sound route for the session be to use the speaker
UInt32 doChangeDefaultRoute = 1;
AudioSessionSetProperty (kAudioSessionProperty_OverrideCategoryDefaultToSpeaker, sizeof (doChangeDefaultRoute), &doChangeDefaultRoute);

//Activate the customized audio session
[[AVAudioSession sharedInstance] setActive: YES error: &activationErr];

after joining the meeting, I was able to still hear the audio at its original volume along with the audio of the meeting.

Can you give this a try and let me know what happens?

Thanks!
Michael

1 Like

Hi @Michael_Condon
You are a lifesaver :medal_sports:! This is really great. I was struggling and had almost given up on this as couldn’t get anything to work. Thank’s a lot for this! :smiley:

So, I was able to set this after the connecting the audio and was able to hear the background volume properly. But one issue was noted. As soon as the background audio is given priority zoom completely loose the mic and audio out too. I tested this with a Zoom meeting with another participant and after audio is overridden cant hear or mic is not sending any audio. Not sure if thats expected or thats the best we can do?

1 Like

Hey @chamathpali,

I am glad that got us headed in the right direction. :slight_smile:

Unfortunately, that is likely the best that can happen. You can try setting it to the other audio categories to see how it is effected, but the SDK was not designed with this feature in mind. You could also try routing to the receiver or speaker to see how that effects things.

Thanks!
Michael

Hey @Michael_Condon,
Thank you once again for the response. Yes i was playing around with it for sometime now and was able to get this mode AVAudioSessionCategoryAmbient to math our usecase. But it would disable the user microphone. But audio can hear both zoom and background.

But its all good now for our application. And we can’t handle all the situations :wink: .
Once again thank for your continued support!.

1 Like

Hey @chamathpali,

You are very welcome :slight_smile: Please let us know if there is anything else we can do to assist.

Thanks!
Michael

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.