title: Android Cannot initialize Visualizer engine, error: -4
body: <p>I have an error in:</p>
  
  <pre><code>public class VisualizerCapture extends Activity implements Visualizer.OnDataCaptureListener {
  private Visualizer mVisualizer = new Visualizer(0); // error is here!!!
  
  @Override
  public void onCreate(Bundle savedInstanceState){
   super.onCreate(savedInstanceState);
  
      setupVisualizer();
  }
  </code></pre>
  
  <p>This is the thrown error:</p>
  
  <pre><code>  java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{bla bla}: java.lang.RuntimeException: Cannot initialize Visualizer engine, error: -4
  </code></pre>
  
  <p>My manifest:</p>
  
  <pre><code>    &lt;uses-permission android:name="android.permission.RECORD_AUDIO"/&gt;
      &lt;uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/&gt;    
      &lt;uses-permission android:name="android.permission.INTERNET"/&gt;         
  </code></pre>
  
  <p>Setup method:</p>
  
  <pre><code>private void setupVisualizer() {
      Visualizer.setEnabled(false);
      Visualizer.setCaptureSize(1);      //test
      Visualizer.setDataCaptureListener(this,250,false,true);
      //Visualizer.setScalingMode(visualizer.SCALING_MODE_AS_PLAYED);
      Visualizer.setEnabled(true);
              Log.v("ABS","setupVisualizer" + Visualizer.getEnabled());    //log
  
  }
  </code></pre>
  
  <p>Why I got this error? Seems like I have sated all permissions?</p>
  
  <p>Be patient please, I am newbie in development. How can I fix this?</p>