How to get the default Equalizer to work with my current Audio Session ID
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
add a comment |
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
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
add a comment |
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
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
android android-mediaplayer equalizer
edited Aug 30 '15 at 19:42
asked Aug 30 '15 at 19:33
Jack
1,02862757
1,02862757
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
add a comment |
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
add a comment |
1 Answer
1
active
oldest
votes
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 need
equalizer.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.
add a comment |
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',
autoActivateHeartbeat: false,
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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 need
equalizer.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.
add a comment |
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 need
equalizer.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.
add a comment |
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 need
equalizer.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.
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 need
equalizer.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.
edited Nov 13 at 20:42
answered Nov 11 at 2:36
william shaw
11
11
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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