Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

[Android] Fatal signal 11 when implemented OnAudioFilterRead after invoke Application.Quit()

Discussion in 'Audio & Video' started by dzadzam, Jan 14, 2016.

  1. dzadzam

    dzadzam

    Joined:
    Feb 2, 2015
    Posts:
    1
    Hi Everyone!
    I'd like to implement custom OnAudioFilterRead methods.
    On scene I have MainCamera object with attached script:

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using UnityEngine.UI;
    4.  
    5. public class OnAudioFilterReadTest : MonoBehaviour {
    6.    
    7.     private float gain = 1f;
    8.  
    9.     void OnGUI()
    10.     {
    11.         if (GUI.Button(new Rect(10, 10, 150, 100), "Exit"))
    12.             OnExitClick();
    13.     }
    14.  
    15.     private void OnExitClick()
    16.     {
    17.         Application.Quit();
    18.     }
    19.  
    20.     void OnAudioFilterRead(float[] data, int channels)
    21.     {
    22.         for (var i = 0; i < data.Length; ++i)
    23.             data[i] = data[i] * gain;
    24.     }
    25. }
    It seems to be ok, but if i close app, i get fatal signal 11 crash on android devices
    Anybody know, what is should do to remove this crash?
    Thanks!
     
  2. wloczykij

    wloczykij

    Joined:
    Sep 4, 2014
    Posts:
    2
    I have the same problem on Android. If you use OnAudioFilterRead Unity will crash while going into background (closing app, watch unityAds...). Nothing usefull in logs :/
    Tested on Unity 5.2, 5.3.1 and multiple android devices.
    Unity please help :(
     
  3. Cromfeli

    Cromfeli

    Joined:
    Oct 30, 2014
    Posts:
    202
    dzadzam likes this.