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

Disabling "Smooth fade in/out" when starts/pauses playback #37

Open
anonym24 opened this issue Apr 16, 2017 · 14 comments
Open

Disabling "Smooth fade in/out" when starts/pauses playback #37

anonym24 opened this issue Apr 16, 2017 · 14 comments
Labels

Comments

@anonym24
Copy link

Hi.
I need fast pause without any fade.
Can I turn it off somehow?

@rtaylor205
Copy link

From what I can see, OpenSLMediaPlayerFactory#createMediaPlayer is creating the OpenSLMediaPlayer using its own getMediaPlayerOptions().

This is hard coded to always return OpenSLMediaPlayer.OPTION_USE_FADE

There doesn't appear to be a way to pass through any options. If you aren't able to make changes to OpenSLMediaPlyaerFactory yourself, instantiate it as an anonymous class, override the getMediaPlayerOptions behaivor and return zero. This disables the fade on both start and pause.

The same thing applies for the hybrid player. Obviously this isn't pretty, ideally there'd be a way to pass this through as a parameter into the media player factories. When I clean things up my side I plan on submitting a PR allowing this to be toggled easier.

		factory = new OpenSLMediaPlayerFactory(activity.getApplicationContext()) {
			
			@Override
			protected int getMediaPlayerOptions () {
				return 0;
			}
			
		};

@h6ah4i
Copy link
Owner

h6ah4i commented Apr 18, 2017

@anonym24 Hi. As @stickyd has mentioned, his solution is the appropreate way to configure OpenSLMediaPlayer/HybridMediaPlayer not to use smooth fading.

@anonym24
Copy link
Author

thanks) it suits me more

@h6ah4i h6ah4i added the question label May 6, 2017
@martppa
Copy link

martppa commented Jul 13, 2017

Hi @h6ah4i. After disabling the Fade effect using the way @stickyd says it works, but then it makes a weird sound after seeking a certain position in the song. How do we fix/avoid it?

@hunnydarapstar
Copy link

@martppa I second you on this. It is making screeching sound on seeking after disabling fade.

@martppa
Copy link

martppa commented Nov 22, 2017

@hunnydarapstar Hi, I fixed this issue. clone my fork and build the native library.

@hunnydarapstar
Copy link

@martppa okay Thanks

@hunnydarapstar
Copy link

@martppa can you build the library and upload it coz I am encountering errors while building from source

@martppa
Copy link

martppa commented Dec 4, 2017

Sure, here you are

https://mega.nz/#!ppIG0a7R!sxRXMZSgqnhlDIopg8f_1yOwb4o-deBdaUJPMy540jw

If you have any other issue let me know.

@hunnydarapstar
Copy link

hunnydarapstar commented Dec 4, 2017

@martppa Thanks a ton bro.. btw I have successfullt build the library from source. Cmake was not installed on my lappy, my bad..!!

@billyjoker
Copy link

billyjoker commented Feb 8, 2018

@stickyd your solution worked for me also!! @martppa Did you see any way to tune the fade in/out times? In order of tune the library i'd like also to tune the max IBasicMediaPlayer instances allowed by the OpenSLMediaPlayerFactory, from current 4 to 5 instances, is it possible to do this without crash?

@martppa
Copy link

martppa commented Feb 8, 2018

@billyjoker Not sure, since the instance is created in the native side and controlled by handlers. I will try to take a look in the code and tell you if it worth to modify it. Tell ya soon.

@billyjoker
Copy link

@martppa did you get something about this one? I'm facing another issue with Visualizer, did you notice that when nothing is sounding you have an amplitude level in the graph? If exists signal, represent a graph independent of the volume level.... it's driving me nuts...

@martppa
Copy link

martppa commented Feb 22, 2018

@billyjoker Hi, sorry for the delay, I have checked the code and there might be a way to solve it, but it might be tedious and a headache since I am not the author.

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

6 participants