버전
menu_open

Audio session interruptions (iOS)

Overview

The Unity Integration supports two audio session categories.

  • AkAudioSessionCategorySoloAmbient (Default): When you use this category, audio from other apps is silenced. Your app's audio is also silenced by screen locking and by the Silent switch (called the Ring/Silent switch on the iPhone).
  • AkAudioSessionCategoryAmbient: AmbientSound allows your app's audio to be mixed with other apps. Any audio interruptions, such as an incoming phone call, or playing music with the Music app using a remote control, will be mixed with your app's audio by default. However, you can specify route sounds and music to a special buss so that they get muted when user music plays and unmuted when user music stops. The muting and unmuting are done by the sound engine internally. You can still define a source-change callback to respond to user music behaviors for other useful tasks, such as updating a UI element to notify users of the user music playback status.

Using both categories, an audio interruption, such as a phone call, will seize the audio session from your app. The necessary audio session management is done internally by the sound engine. However, the app may perform other tasks such as UI updates to notify user of the interruptions. To achieve this, the app need to specify an interruption listener callback function to respond to the events of entering and exiting the audio interruption. In the case of user music, another dedicated callback source-change callback can be defined to respond to the events of stopping the user music. The proper pause and resume actions on playing sounds are handled by the sound engine internally.

Playing user music using the remote-control will trigger an interruption (under the SoloAmbient category) or a special source-change event (under the Ambient category), however, stopping user music using the remote-control will trigger a source-change under all categories. Again, the sound engine takes care of all the audio pipeline tasks regarding such events. The app can register a source-change callback to respond to these events if extra work is needed.

The callback and the remote control

Unlike phone calls and clock alarms, which trigger the interruption callback at both the start and the end of an interruption, the remote control only triggers the callback when the interruption starts. Furthermore, the iOS SDK provides no means to differentiate between the interruption sources. To handle all types of interruptions under the SoloAmbientSound category, you need to resort to your app's UI to guide your users to restore the app's audio, with the help of the interruption listener callback.

The procedure

  1. Ensure Unity's built-in audio is disabled. Check in the menu Edit > Project Settings > Audio, option Disable Audio.
  2. (Optional) Add a callback based on the prototype AkCallbackManager.AudioInterruptionCallback(), and use AkCallbackManager.SetInterruptionCallback() to register it.
  3. (Optional) Add a callback based on the prototype AkCallbackManager.AudioSourceChangeCallback(), and use AkCallbackManager.SetSourceChangeCallback() to register it.
Generated on Tue Aug 23 02:44:59 2016 for Wwise Unity Integration by  doxygen 1.6.3

이 페이지가 도움이 되었나요?

지원이 필요하신가요?

질문이 있으신가요? 문제를 겪고 계신가요? 더 많은 정보가 필요하신가요? 저희에게 문의해주시면 도와드리겠습니다!

지원 페이지를 방문해 주세요

작업하는 프로젝트에 대해 알려주세요. 언제든지 도와드릴 준비가 되어 있습니다.

프로젝트를 등록하세요. 아무런 조건이나 의무 사항 없이 빠른 시작을 도와드리겠습니다.

Wwise를 시작해 보세요