Skip to content
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] AudioSessionOperationRestriction doesn't work #835

Open
liamdo192 opened this issue Oct 29, 2024 · 2 comments
Open

[iOS] AudioSessionOperationRestriction doesn't work #835

liamdo192 opened this issue Oct 29, 2024 · 2 comments

Comments

@liamdo192
Copy link

Describe the bug
I want to customize the AudioSession myself. I tried setting AudioSessionOperationRestrictionAll or AudioSessionOperationRestrictionSetCategory, but it doesn’t work. The AudioSession still changes when joining a channel.

To Reproduce
Steps to reproduce the behavior:

  1. Before joining a session, the AudioSession is set to AVAudioSessionCategorySoloAmbient with AVAudioSessionModeDefault
  2. I set AudioSessionOperationRestrictionAll before joining the session. (Also tried AudioSessionOperationRestrictionSetCategory too)
  3. After joining the session, the AudioSession changes to AVAudioSessionCategoryPlayAndRecord with AVAudioSessionModeVoiceChat

Expected behavior
I don’t want the Agora SDK to affect my custom Audio Session

Logs
[2024-10-29 10:31:42.838][1978485][I][iris_rtc_api_engine.cc:387] api name RtcEngine_setAudioSessionOperationRestriction_c492897 params "{"restriction":2}"
[2024-10-29 10:31:42.838][1978485][I][iris_rtc_api_engine.cc:451] api name RtcEngine_setAudioSessionOperationRestriction_c492897 result 0 outdata {"result":0}

Smartphone (please complete the following information):

  • OS: iOS 17.5
  • React Native: 0.72.12
  • Agora version: 4.4.0

Additional context
I want to make a video call and play a local audio file in the same time. So I want to custom Audio Session to resolve the volume issue.

@guoxianzhe
Copy link
Contributor

@liamdo192 Can you setAudioSessionOperationRestriction after engine.initialize immediately and try again? If still not work , pls contact to our tech support with detail logs : https://www.agora.io/en/customer-support/

@liamdo192
Copy link
Author

I added it after engine.initialize, but it doesn't work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants