question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

the error meassage:E/AudioEffect: set(): AudioFlinger could not create effect, status: -1 04-17 21:49:09.967 24849-24849/? E/visualizers-JNI: Visualizer initCheck failed E/Visualizer-JAVA: Error code -3 when initializing Visualizer.

See original GitHub issue
public class MonitorSoundFragment extends Fragment {

    private static final String TAG = "MonitorSoundFragment.class";

    private BarVisualizer envirnment_bar;

    public static MonitorSoundFragment newIntance() {
        return new MonitorSoundFragment();
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_monitor_sound, null);
        findViews(view);
        return view;
    }

    private void findViews(View view) {
        envirnment_bar = view.findViewById(R.id.environment_shower);
        envirnment_bar.setDensity(70);
        envirnment_bar.setColor(R.color.colorAccent);
        //获取AudioManager
        AudioManager audioManager = (AudioManager) getActivity().getSystemService(Context.AUDIO_SERVICE);
        envirnment_bar.setPlayer(audioManager.generateAudioSessionId());
        int volume = audioManager.getStreamVolume(AudioManager.STREAM_MUSIC);
        Log.i(TAG, "current volume" + volume);
    }
}

this is my code, I find the parameter is int audioSessionId,So I used this method of audiomanager, but it doesn’t seem feasible

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
anantshah93commented, Sep 15, 2020

I also found same issue I have added permissions: <uses-permission android:name="android.permission.RECORD_AUDIO"/> <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/> <uses-permission android:name="android.permission.INTERNET"/>

And verified it has permission still getting this issue

E/AudioEffect: set(): AudioFlinger could not create effect e46b26a0-dddd-11db-8afd-0002a5d5c51b / , status: -2 E/visualizers-JNI: Visualizer initCheck failed -3 E/Visualizer-JAVA: Error code -3 when initializing Visualizer.

I have tried to set audio player’s session ID “1009” (mAudioPlayer.getAudioSessionId()😉 and “0” also but none is working

0reactions
minthukhant-thedevelopercommented, Nov 11, 2022

also i found same error :

E/AudioEffect( 5739): set(): AudioFlinger could not create effect 0bed4300-ddd6-11db-8f34-0002a5d5c51b / ec7178ec-e5e1-4432-a3f4-4657e6795210, status: -1
E/AudioEffects-JNI( 5739): AudioEffect initCheck failed -3
E/AudioEffect-JAVA( 5739): Error code -3 when initializing AudioEffect.

This is permission issue. Make sure your app have android.permission.RECORD_AUDIO permission.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error AudioEffect: set(): AudioFlinger could not create effect -1
In my Flutter application I need to retrive sound data (for my own visualizer) witch currently playing. I have the audioSessionId, ...
Read more >
Preprocessing in Hangout - Google Groups
As a result, below error happens during one Hangout call: ... 11748 E AudioEffect: set(): AudioFlinger could not create effect, status: -22.
Read more >
Visualizer initCheck failed - Android Development
I'm trying to create a simple audio visualizer app but keep getting this error while trying to instantiate the Visualizer class.
Read more >
No audio on Shield TV - AudioTrack.DynamicsProcessing.ctor ...
was approved, I've been unable to get any audio output on both my Shield TV ... (942 990) E Error code -3 when...
Read more >
Visualizer initCheck failed -3( Error code - CSDN博客
问题:. E/AudioEffect: set(): AudioFlinger could not create effect, status: -1. E/visualizers-JNI: Visualizer initCheck failed -3
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found