Search Issue Tracker
Won't Fix
Votes
6
Found in
2019.4
2020.2
2020.2.0b1
Issue ID
1276572
Regression
No
[iOS] Audio files are not played when using CallKit
Reproduction steps:
1. Download and open the attached "BugReproProject" project
2. In the Menu bar, press "File" > "Build Settings..."
3. Switch to iOS platform, build and deploy the project
(The following steps are made on the device)
4. Press the "PLAY AUDIO" button (an audio clip starts playing)
5. Press the "CALL" button (audio clip stops playing) and then the "END CALL" button
6. Press the "PLAY AUDIO" button again
Expected result: An audio clip starts playing
Actual result: Audio clip doesn't start playing
Reproduces on: 2019.4.12f1, 2020.1.9f1, 2020.2.0b7
Could not test with: 2018.4, 2021.1 (Console errors)
Tested with:
iPhone 6 (iOS 12.4.8)
iPhone 6s (iOS 13.3.1)
iPhone 7 (iOS 12.3.1)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Texture2D hash changes inside of an AssetBundle when rebuilding a SpriteAtlas bundle with an empty AssetPostprocessor Script enabled
- Aniso Level still applies when Generate MipMap is disabled in Texture Import Settings
- Mipmap Limit Groups long names are not truncated when creating a new Mipmap Limit Group with a long name
- “ArgumentException: Invalid double parameter.” error is thrown when Infinity is typed into the Fixed Timestep field
- GameObject becomes gray when using HDRP and STP together on macOS
Resolution Note (2021.2.X):
On iOS Unity uses AVAudioSession for audio playback. Unity takes care of different interuptions and state changes of AVAudioSession to keep audio playing. From OS standpoint disabling app's AVAudioSession does not count as interuption or notifiable state change, as AVAudioSession active state can only be changed with intent from user. In this case disabling of AVAudioSession happens when a call is ended, user is notified of this in CXProviderDelegate provider:didDeactivateAudioSession: method. Disabling AVAudioSession is destructive operation so we do not recommend using it.
In case AVAudioSession has been disabled Unity audio can be restored calling AudioSettings.Reset() in C# script or UnitySetAudioSessionActive() in native plugin. These calls do restore audio, but they resets audio state as well, meaning all audio sources in the scene are stopped.