Suspend() public static method

public static Suspend ( ) : AKRESULT
return AKRESULT
Ejemplo n.º 1
0
 /// <summary>
 /// Pauses the game, disables the playermovement script.
 /// </summary>
 public void Pause()
 {
     Time.timeScale     = 0;
     playerMove.enabled = false;
     AkSoundEngine.Suspend(true);
     leftLight.Stop();
     rightLight.Stop();
 }
 private static void SuspendEngine(bool isMuted)
 {
     if (isMuted)
     {
         AkSoundEngine.Suspend(true);
         isSuspended = true;
     }
     else
     {
         isSuspended = false;
         AkSoundEngine.WakeupFromSuspend();
         AkSoundEngine.RenderAudio(true);
     }
 }
Ejemplo n.º 3
0
 void OnApplicationFocus(bool focus)
 {
     if (ms_Instance != null)
     {
         if (focus)
         {
             AkSoundEngine.WakeupFromSuspend();
         }
         else
         {
             AkSoundEngine.Suspend();
         }
         AkSoundEngine.RenderAudio();
     }
 }
Ejemplo n.º 4
0
 //Keep out of UNITY_EDITOR because the sound needs to keep playing when switching windows (remote debugging in Wwise, for example).
 //On the WiiU, it seems Unity has a bug and never calls OnApplicationFocus(true).  This leaves us in "suspended mode".  So commented out for now.
 //On iOS, application interruptions are handled in the sound engine already.
 void OnApplicationPause(bool pauseStatus)
 {
     if (ms_Instance != null)
     {
         if (!pauseStatus)
         {
             AkSoundEngine.WakeupFromSuspend();
         }
         else
         {
             AkSoundEngine.Suspend();
         }
         AkSoundEngine.RenderAudio();
     }
 }
Ejemplo n.º 5
0
    private static void ActivateAudio(bool activate)
    {
        if (ms_Instance != null)
        {
            if (activate)
            {
                AkSoundEngine.WakeupFromSuspend();
            }
            else
            {
                AkSoundEngine.Suspend();
            }

            AkSoundEngine.RenderAudio();
        }
    }
Ejemplo n.º 6
0
    // Enable/Disable the audio when pressing play/pause in the editor.
    private static void OnEditorPlaymodeStateChanged()
    {
        if (ms_Instance != null)
        {
            if (EditorApplication.isPaused)
            {
                AkSoundEngine.Suspend();
            }
            else
            {
                AkSoundEngine.WakeupFromSuspend();
            }

            AkSoundEngine.RenderAudio();
        }
    }
    private void ActivateAudio(bool activate)
    {
        if (AkSoundEngine.IsInitialized())
        {
            if (activate)
            {
                AkSoundEngine.WakeupFromSuspend();
            }
            else
            {
                AkSoundEngine.Suspend();
            }

            AkSoundEngine.RenderAudio();
        }
    }
Ejemplo n.º 8
0
    //On the WiiU, it seems Unity has a bug and never calls OnApplicationFocus(true).  This leaves us in "suspended mode".  So commented out for now.
    void OnApplicationPause(bool pauseStatus)
    {
#if UNITY_IOS
        AkSoundEngine.ListenToAudioSessionInterruption(pauseStatus);
#endif
        if (ms_Instance != null)
        {
            if (!pauseStatus)
            {
                AkSoundEngine.WakeupFromSuspend();
            }
            else
            {
                AkSoundEngine.Suspend();
            }
            AkSoundEngine.RenderAudio();
        }
    }
    public void Init(AkInitializer akInitializer)
    {
        if (akInitializer == null)
        {
            UnityEngine.Debug.LogError("WwiseUnity: AkInitializer must not be null. Sound engine will not be initialized.");
            return;
        }

#if UNITY_EDITOR
        if (UnityEngine.Application.isPlaying && !IsTheSingleOwningInitializer(akInitializer))
        {
            UnityEngine.Debug.LogError("WwiseUnity: Sound engine is already initialized.");
            return;
        }

        var arguments = System.Environment.GetCommandLineArgs();
        if (System.Array.IndexOf(arguments, "-nographics") >= 0 &&
            System.Array.IndexOf(arguments, "-wwiseEnableWithNoGraphics") < 0)
        {
            return;
        }

        var isInitialized = false;
        try
        {
            isInitialized       = AkSoundEngine.IsInitialized();
            IsSoundEngineLoaded = true;
        }
        catch (System.DllNotFoundException)
        {
            IsSoundEngineLoaded = false;
            UnityEngine.Debug.LogWarning("WwiseUnity: AkSoundEngine is not loaded.");
            return;
        }
#else
        var isInitialized = AkSoundEngine.IsInitialized();
#endif

        AkLogger.Instance.Init();

        if (isInitialized)
        {
#if UNITY_EDITOR
            if (AkWwiseInitializationSettings.ResetSoundEngine(UnityEngine.Application.isPlaying || UnityEditor.BuildPipeline.isBuildingPlayer))
            {
                UnityEditor.EditorApplication.update += LateUpdate;
            }

            if (UnityEditor.EditorApplication.isPaused && UnityEngine.Application.isPlaying)
            {
                AkSoundEngine.Suspend(true);
            }
#else
            UnityEngine.Debug.LogError("WwiseUnity: Sound engine is already initialized.");
#endif
            return;
        }

#if UNITY_EDITOR
        if (UnityEditor.BuildPipeline.isBuildingPlayer)
        {
            return;
        }
#endif

        if (!AkWwiseInitializationSettings.InitializeSoundEngine())
        {
            return;
        }

#if UNITY_EDITOR
        OnEnableEditorListener(akInitializer.gameObject);
        UnityEditor.EditorApplication.update += LateUpdate;
#endif
    }
Ejemplo n.º 10
0
 public void AudioPause()
 {
     AkSoundEngine.PostEvent("Stop_Sound", mGlobalObject);
     AkSoundEngine.Suspend();
 }
Ejemplo n.º 11
0
 public void suspend()
 {
     AkSoundEngine.Suspend();
 }