Audiokinetic's Community Q&A is the forum where users can ask and answer questions within the Wwise and Strata communities. If you would like to get an answer from Audiokinetic's Technical support team, make sure you use the Support Tickets page.

0 votes
When playing music from the music player, wwise stops every sound, as it should be, but when the user pauses the music player, no sound is heard anymore, not even when new PostEvent are sent.

Is there any functions to call when the user pauses the music player I can call to resume wwise activity?

Thanks!
in General Discussion by David R. (180 points)

1 Answer

0 votes

What audio session category do you use? By default, Wwise uses kAudioSessionCategory_SoloAmbientSound. Along with kAudioSessionCategory_PlayAndRecord, under these audio session categories, only one audio app can be active on the device (Refer to Xcode documenatation for detail). So the music player may act as an audio session interruption to kill your app's audio. You'll then need to register a user callback to bring the audio back after the interruption ends. See the example in the IntegrationDemo for iOS. The example uses a callback DemoInterruptCallbackFunc() to register an UIAlertView for user to actively restore the app's audio. Note that this kind of UI-driven "active restoration" is only necessary for interruption from the Remove-Control (including the Control Center, and the ear-bud) and the Music app. Other interruptions such as a phone call or an alarm do not need the active restoration; the sound engine can handle the restoration automatically when the intrruption is over.

On the other hand, using the audio session catetory kAudioSessionCategory_AmbientSound, all apps' audio can mix with each other, bypassing the interruption problem.

You are recommended to read the SDK doc for the iOS-only callback: AudioInterruptionCallbackFunc() and the related topics.

 

 

by Beinan L. (Audiokinetic) (1.2k points)
edited by Beinan L. (Audiokinetic)
When Siri or Face time or Alarm interrupts, audio is lost in the app that uses kAudioSessionCategory_AmbientSound audio session category. In AudioInterruptionCallbackFunc what should be done/called to restore the audio?
...