By Bel

2013-01-30 11:43:04 8 Comments

Help me please, how fix this?

public class VisualizerCapture extends Activity implements Visualizer.OnDataCaptureListener
private Visualizer mVisualizer;

public void onCreate(Bundle savedInstanceState){
    mVisualizer = new Visualizer(0);

private void setupVisualizer() {
    mVisualizer.setCaptureSize(8);      //test
            Log.v("ABS","setupVisualizer" + mVisualizer.getEnabled());    //log

This code throws error: ERROR/AudioEffect(2393): set(): AudioFlinger could not create effect, status: -22

that was in xml

 <uses-permission android:name="android.permission.RECORD_AUDIO"/>             
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>


java.lang.RuntimeException: Unable to start activity ComponentInfo{blabla}: java.lang.RuntimeException: Cannot initialize Visualizer engine, error: -4 at at at$600( at$H.handleMessage( at android.os.Handler.dispatchMessage( at android.os.Looper.loop( at at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke( at$ at at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.RuntimeException: Cannot initialize Visualizer engine, error: -4 at at com.blablabeta.gui.VisualizerCapture.onCreate( at at at

That is it? and how to fix this error?


@Bel 2013-02-01 08:01:55

The problem was gone then I test my app on real phone. somthing wrong with emulator.

@Michael 2013-01-30 12:13:36

When using the Visualizer on session 0 you need to have MODIFY_AUDIO_SETTINGS and RECORD_AUDIO permissions, but I'm guessing that your app has those because otherwise you'd get a PERMISSION_DENIED error (-1 if I remember correctly).

Status -22 ought to be BAD_VALUE. It's not entirely clear to me from the information available in the question why this would happen. Perhaps there's more information available in the logcat output in addition to that line you pasted. Potential reasons for why you'd end up with a BAD_VALUE status would be e.g. that the effect isn't found, or that the effect already has been inserted in the effect chain.

@Bel 2013-01-30 12:38:29

added logcat, its a bit fixed, but only in file names.

@Shreyash Mahajan 2013-04-12 05:07:42

@Michael: Same error i found on the constructer of the Equalizer. Please help for that.

Related Questions

Sponsored Content

12 Answered Questions

[SOLVED] Android - How to download a file from a webserver

2 Answered Questions

1 Answered Questions

[SOLVED] I am getting the Following error when executing the code

  • 2014-05-17 06:05:45
  • munishguptamg
  • 134 View
  • 0 Score
  • 1 Answer
  • Tags:   android

4 Answered Questions

[SOLVED] Android app does not work on Tablet

1 Answered Questions

[SOLVED] Android MySQL issue in Android 4.0 only?

1 Answered Questions

[SOLVED] Changed to gridview application now crashes?

Sponsored Content