BlackyHawky / Clock

Privacy-conscious open-source clock, based on AOSP Clock
Apache License 2.0
245 stars 15 forks source link

Implement gapless playback for looped ringtones #129

Open ltguillaume opened 4 days ago

ltguillaume commented 4 days ago

Is your feature request related to a problem? Please describe.

Ever since Android 12, it seems that many clock apps have an issue with looped playback: files that previously looped gaplessly, now have a gap introduced between every loop.

Describe the solution you'd like

Since many ringtones sound strange with a gap between loops, it would be great if gapless playback can be reintroduced.

There's only one clock app I've found so far that does perfectly play gapless loops on Android 12+: https://github.com/gabeg805/NFC-Alarm-Clock/

It seems that it uses ExoPlayer for playback, perhaps this is the cause for that? (https://github.com/gabeg805/NFC-Alarm-Clock/blob/main/app/src/main/kotlin/com/nfcalarmclock/system/mediaplayer/NacMediaPlayer.kt)

BlackyHawky commented 3 days ago

Since many ringtones sound strange...

Strange because I don't notice this on my devices with Android 12 and 14.

... with a gap between loops

There's only a single second between 2 ringtone launches and I don't find it that bothersome. 🤔

it would be great if gapless playback can be reintroduced.

Are you sure this has already been introduced? If so, I don't know about it.

In any case, I'm not sure I want to add new dependencies just for a short second between 2 ringtones...

ltguillaume commented 3 days ago

Nah, I understand that it's going too far to add new dependencies.

I just don't understand what happened after Android 12+. Nice little ringtones like the following one just stopped... well, being nice 😉

Anticipation.zip

BlackyHawky commented 3 days ago

It's true that with the ringtone you've attached it's not very pretty. 😅 Perhaps using ExoPlayer would also solve #98.

To be tested in the hope that it will be easy to implement...