SimpleMobileTools / Simple-Music-Player

A clean music player with a customizable widget, stylish interface and no ads.
https://www.simplemobiletools.com
GNU General Public License v3.0
1.26k stars 410 forks source link

Tune skip silence threshold #595

Closed naveensingh closed 10 months ago

naveensingh commented 10 months ago

This ensures we don't skip any short pauses in the middle of a track.

tibbi commented 10 months ago

this also ends songs quicker if there is no music in the end, not sure if thats the expected behaviour? Like a song long 5:12 ends at 5:09 if nothing plays already.

tibbi commented 10 months ago

I think the previous way of gapless playback is the expected one

naveensingh commented 10 months ago

this also ends songs quicker if there is no music in the end, not sure if thats the expected behaviour? Like a song long 5:12 ends at 5:09 if nothing plays already.

that's why it's called skip silence :)

I think the previous way of gapless playback is the expected one

That part works as expected and is enabled by default, We can not really disable this seamless transition between tracks without adding some delay for delay's sake. Skip silence is optional and not required for gapless playback. That's what this comment was all about. Whether we still wanna keep the switch or repurpose it since it is redundant now.

tibbi commented 10 months ago

lets disable skipping silence, keep just the old gapless playback. Not sure if this PR is needed for it at all then.

naveensingh commented 10 months ago

right but what about the preference? What's it gonna do now?

tibbi commented 10 months ago

work just as previously, it doesnt need change

naveensingh commented 10 months ago

I think I need to clarify this further:

How gapless playback worked before:

With the Android media player, it took like a second or two before the next track could start so it wasn't very seamless. When people requested gapless playback, I used two media player instances and called firstMediaPlayer.setNextMediaPlayer(nextMediaPlayer) to transition to the next track as seamlessly as possible. This allowed seamless transition between tracks. But I'd seen reports in other apps that setNextMediaPlayer() is not very reliable, so I disabled it by default and added a preference named Gapless playback that users can enable if they want to.

How it works now:

With media3 changes, the MediaPlayer was replaced with google's ExoPlayer, and ExoPlayer transitions between tracks as seamlessly as possible. There is no on/off button for gapless playback now and the preference is now redundant.

Note: This seamless transition is not truly gapless, it wasn't that truly gapless before either. True gapless playback will require more work/research.

tibbi commented 10 months ago

you had some sample audio files before that connect to each other, are you using it for testing?

naveensingh commented 10 months ago

yes, this time I tested using a sine wave tone split into multiple parts, it works better for testing. Here it is: tone.zip

I always notice a slight crack/pop noise during the transition on the phone speaker but not on Bluetooth, in both media player and exoplayer versions. It's not noticeable when playing actual gapless albums like the dark side of the moon

tibbi commented 10 months ago

ok, lets use the new skip silence then, but keep the old string. Will see what feedback we get.

naveensingh commented 10 months ago

ok then I'll close the other https://github.com/SimpleMobileTools/Simple-Music-Player/pull/593 PR, This one should be merged though so that we only trim silence at the start/end

tibbi commented 10 months ago

alright thanks, that should be good