How to get the default Equalizer to work with my current Audio Session ID











up vote
2
down vote

favorite
1












I want to make the users default equalizer work with my app, but I can't seem to get my app audio session to connect with the equalizer even though I am passing it my Audio Session ID etc.



Here is my code:



          Intent i = new Intent(AudioEffect.ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL);
i.putExtra(AudioEffect.EXTRA_AUDIO_SESSION, MusicPlayerService.getMPSessionId());
startActivityForResult(i, 11113);


I am using the code above to launch the user's default Equalizer.



    @Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (resultCode == RESULT_OK) {

System.out.println("RESULT_OK");

Equalizer equalizer = new Equalizer(0,MusicPlayerService.getMPSessionId());
equalizer.setEnabled(true);

return;
}

}


And then I am using the code above to apply enable and apply it. What am I doing wrong here? I have a few apps on my phone that use the stock Equalizer and they all work fine.



If somebody could help me out, that would be highly appreciated, thanks.










share|improve this question




















  • 1




    Did you find any solution ? If yes can you please share it ?
    – akshay7692
    Jul 25 '16 at 14:52






  • 1




    Hi, did you find any solution?
    – NehaK
    Jul 18 '17 at 12:14















up vote
2
down vote

favorite
1












I want to make the users default equalizer work with my app, but I can't seem to get my app audio session to connect with the equalizer even though I am passing it my Audio Session ID etc.



Here is my code:



          Intent i = new Intent(AudioEffect.ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL);
i.putExtra(AudioEffect.EXTRA_AUDIO_SESSION, MusicPlayerService.getMPSessionId());
startActivityForResult(i, 11113);


I am using the code above to launch the user's default Equalizer.



    @Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (resultCode == RESULT_OK) {

System.out.println("RESULT_OK");

Equalizer equalizer = new Equalizer(0,MusicPlayerService.getMPSessionId());
equalizer.setEnabled(true);

return;
}

}


And then I am using the code above to apply enable and apply it. What am I doing wrong here? I have a few apps on my phone that use the stock Equalizer and they all work fine.



If somebody could help me out, that would be highly appreciated, thanks.










share|improve this question




















  • 1




    Did you find any solution ? If yes can you please share it ?
    – akshay7692
    Jul 25 '16 at 14:52






  • 1




    Hi, did you find any solution?
    – NehaK
    Jul 18 '17 at 12:14













up vote
2
down vote

favorite
1









up vote
2
down vote

favorite
1






1





I want to make the users default equalizer work with my app, but I can't seem to get my app audio session to connect with the equalizer even though I am passing it my Audio Session ID etc.



Here is my code:



          Intent i = new Intent(AudioEffect.ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL);
i.putExtra(AudioEffect.EXTRA_AUDIO_SESSION, MusicPlayerService.getMPSessionId());
startActivityForResult(i, 11113);


I am using the code above to launch the user's default Equalizer.



    @Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (resultCode == RESULT_OK) {

System.out.println("RESULT_OK");

Equalizer equalizer = new Equalizer(0,MusicPlayerService.getMPSessionId());
equalizer.setEnabled(true);

return;
}

}


And then I am using the code above to apply enable and apply it. What am I doing wrong here? I have a few apps on my phone that use the stock Equalizer and they all work fine.



If somebody could help me out, that would be highly appreciated, thanks.










share|improve this question















I want to make the users default equalizer work with my app, but I can't seem to get my app audio session to connect with the equalizer even though I am passing it my Audio Session ID etc.



Here is my code:



          Intent i = new Intent(AudioEffect.ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL);
i.putExtra(AudioEffect.EXTRA_AUDIO_SESSION, MusicPlayerService.getMPSessionId());
startActivityForResult(i, 11113);


I am using the code above to launch the user's default Equalizer.



    @Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (resultCode == RESULT_OK) {

System.out.println("RESULT_OK");

Equalizer equalizer = new Equalizer(0,MusicPlayerService.getMPSessionId());
equalizer.setEnabled(true);

return;
}

}


And then I am using the code above to apply enable and apply it. What am I doing wrong here? I have a few apps on my phone that use the stock Equalizer and they all work fine.



If somebody could help me out, that would be highly appreciated, thanks.







android android-mediaplayer equalizer






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Aug 30 '15 at 19:42

























asked Aug 30 '15 at 19:33









Jack

1,02352757




1,02352757








  • 1




    Did you find any solution ? If yes can you please share it ?
    – akshay7692
    Jul 25 '16 at 14:52






  • 1




    Hi, did you find any solution?
    – NehaK
    Jul 18 '17 at 12:14














  • 1




    Did you find any solution ? If yes can you please share it ?
    – akshay7692
    Jul 25 '16 at 14:52






  • 1




    Hi, did you find any solution?
    – NehaK
    Jul 18 '17 at 12:14








1




1




Did you find any solution ? If yes can you please share it ?
– akshay7692
Jul 25 '16 at 14:52




Did you find any solution ? If yes can you please share it ?
– akshay7692
Jul 25 '16 at 14:52




1




1




Hi, did you find any solution?
– NehaK
Jul 18 '17 at 12:14




Hi, did you find any solution?
– NehaK
Jul 18 '17 at 12:14












1 Answer
1






active

oldest

votes

















up vote
0
down vote













mAudioSession = mp.getAudioSessionId();

try {

final Intent effects = new Intent(AudioEffect.ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL);

effects.putExtra(AudioEffect.EXTRA_PACKAGE_NAME, this.getPackageName());

effects.putExtra(AudioEffect.EXTRA_AUDIO_SESSION, mAudioSession);

startActivityForResult(effects, 0);

} catch (Exception e) {

// ignored. Whee!

}


First add this code, int mAudioSession = 0; , above mAudioSession line, if that makes sense. This code should work, tested it and it works fine. I think what youre missing is, Package name, Also you don't needequalizer.enabled` true, it won't do anything at all, I think that's for making you're own equalizer. Also I think you can use equalizer.setenabled(true) etc.






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














     

    draft saved


    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f32300365%2fhow-to-get-the-default-equalizer-to-work-with-my-current-audio-session-id%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    mAudioSession = mp.getAudioSessionId();

    try {

    final Intent effects = new Intent(AudioEffect.ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL);

    effects.putExtra(AudioEffect.EXTRA_PACKAGE_NAME, this.getPackageName());

    effects.putExtra(AudioEffect.EXTRA_AUDIO_SESSION, mAudioSession);

    startActivityForResult(effects, 0);

    } catch (Exception e) {

    // ignored. Whee!

    }


    First add this code, int mAudioSession = 0; , above mAudioSession line, if that makes sense. This code should work, tested it and it works fine. I think what youre missing is, Package name, Also you don't needequalizer.enabled` true, it won't do anything at all, I think that's for making you're own equalizer. Also I think you can use equalizer.setenabled(true) etc.






    share|improve this answer



























      up vote
      0
      down vote













      mAudioSession = mp.getAudioSessionId();

      try {

      final Intent effects = new Intent(AudioEffect.ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL);

      effects.putExtra(AudioEffect.EXTRA_PACKAGE_NAME, this.getPackageName());

      effects.putExtra(AudioEffect.EXTRA_AUDIO_SESSION, mAudioSession);

      startActivityForResult(effects, 0);

      } catch (Exception e) {

      // ignored. Whee!

      }


      First add this code, int mAudioSession = 0; , above mAudioSession line, if that makes sense. This code should work, tested it and it works fine. I think what youre missing is, Package name, Also you don't needequalizer.enabled` true, it won't do anything at all, I think that's for making you're own equalizer. Also I think you can use equalizer.setenabled(true) etc.






      share|improve this answer

























        up vote
        0
        down vote










        up vote
        0
        down vote









        mAudioSession = mp.getAudioSessionId();

        try {

        final Intent effects = new Intent(AudioEffect.ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL);

        effects.putExtra(AudioEffect.EXTRA_PACKAGE_NAME, this.getPackageName());

        effects.putExtra(AudioEffect.EXTRA_AUDIO_SESSION, mAudioSession);

        startActivityForResult(effects, 0);

        } catch (Exception e) {

        // ignored. Whee!

        }


        First add this code, int mAudioSession = 0; , above mAudioSession line, if that makes sense. This code should work, tested it and it works fine. I think what youre missing is, Package name, Also you don't needequalizer.enabled` true, it won't do anything at all, I think that's for making you're own equalizer. Also I think you can use equalizer.setenabled(true) etc.






        share|improve this answer














        mAudioSession = mp.getAudioSessionId();

        try {

        final Intent effects = new Intent(AudioEffect.ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL);

        effects.putExtra(AudioEffect.EXTRA_PACKAGE_NAME, this.getPackageName());

        effects.putExtra(AudioEffect.EXTRA_AUDIO_SESSION, mAudioSession);

        startActivityForResult(effects, 0);

        } catch (Exception e) {

        // ignored. Whee!

        }


        First add this code, int mAudioSession = 0; , above mAudioSession line, if that makes sense. This code should work, tested it and it works fine. I think what youre missing is, Package name, Also you don't needequalizer.enabled` true, it won't do anything at all, I think that's for making you're own equalizer. Also I think you can use equalizer.setenabled(true) etc.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 13 at 20:42

























        answered Nov 11 at 2:36









        william shaw

        11




        11






























             

            draft saved


            draft discarded



















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f32300365%2fhow-to-get-the-default-equalizer-to-work-with-my-current-audio-session-id%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Xamarin.iOS Cant Deploy on Iphone

            Glorious Revolution

            Dulmage-Mendelsohn matrix decomposition in Python