Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setEqualizer doesn't work? #58

Open
HelgeStenstrom opened this issue Dec 21, 2019 · 2 comments
Open

setEqualizer doesn't work? #58

HelgeStenstrom opened this issue Dec 21, 2019 · 2 comments
Assignees
Labels

Comments

@HelgeStenstrom
Copy link
Collaborator

public void setEqualizer(final float[] array, final int stop) {
if (!isPausedOrPlaying() || !(audioInputStream instanceof PropertiesContainer))
return;
// Map<?, ?> map = ((PropertiesContainer) audioInputStream).properties()
final float[] equalizer = (float[]) ((PropertiesContainer) audioInputStream).properties().get("mp3.equalizer");
if (stop >= 0) System.arraycopy(array, 0, equalizer, 0, stop);
}

I can't see that this method has any side effect, desired or not. It copies an array passed to it, into a local variable, and when the method goes out of scope, the copy is lost.

What is the intention with the method? If it never has worked as intended, maybe it should be removed.

@goxr3plus
Copy link
Owner

Well it does but in a strange way i haven't fully understood , you can see it working in XR3Player . I have 16 filters which change the audio .

How it works ?.... You can have a look on this class how i use it in XR3Player ...

https://github.com/goxr3plus/XR3Player/blob/1e2c23a84fcd02fcc14cb262f5aaa5b7116451d4/src/main/java/com/goxr3plus/xr3player/controllers/xplayer/XPlayerEqualizer.java#L72-L85

It really works but i am not fully aware how internally.

@HelgeStenstrom HelgeStenstrom self-assigned this Jan 1, 2020
@HelgeStenstrom
Copy link
Collaborator Author

I can't see that setEqualizer is used in the lines you are referring to, but it's called at line 375. I still don't see what happens. When you say "It really works but i am not fully aware how internally", what do you mean by internally?

Is there any way to validate this code, other that running it, and listening to the result?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants