gdelataillade / alarm

A Flutter plugin to easily manage alarms on iOS and Android
https://pub.dev/packages/alarm
MIT License
132 stars 86 forks source link

The alarm can't stop the audio file that was copied to the getApplicationSupportDirectory() path automatically. #233

Open pyjserv opened 3 months ago

pyjserv commented 3 months ago

Hi @gdelataillade,

Alarm plugin version 3.1.5

Describe the bug Because I don't know how to play a ringtone with alarm by the uri, I duplicated the built-in ringtone file to my app's directory with uri_to_file. Even if I set the loop to 'false', when the alarm plays the '.ogg' audio file that was copied to the 'getApplicationSupportDirectory()' path, the line 'onAudioComplete?.invoke()' in 'AudioService.kt' is never invoked.

The 'getApplicationSupportDirectory()' method is from path_provider package. On my Android device, the actual path is '/data/user/0/com.claberi.consillia/files/'.

gdelataillade commented 2 months ago

Hi @pyjserv

I just released version 4.0.0-dev.1 which is a testing version before releasing definitive 4.0.0. I made big refactoring in the native android code so I hope it will fix your issue.

pyjserv commented 2 months ago

Hi @gdelataillade

I tested version 4.0.0-dev.1, but the issue still persists—the music continues to loop.

Edit: This is really strange. On my Samsung phone and tablet, only the built-in ringtones keep looping (even if I’ve copied them to another location). If I use custom music ringtones, the alarm works normally and only plays once.