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

Allow users to select a Custom alarm audio file. #8

Closed
wants to merge 12 commits into from

Conversation

magnus-ISU
Copy link

As noted by the app now when you choose a custom file as your alarm sound, this can cause a crash when it attempts to play audio if the user picks the wrong thing, specifically if they try to use a playlist file (.m3u) as their custom file. You can probably detect this crash right as they pick the file rather when it is attempted to be played but I don't care to try to. Or figure out the mime type and try to exclude it that way - but I have been very frustrated by many apps that expect all audio files to be mp3s and would rather allow the user to figure it out than restrict them artificially.

There is also a crash which I'm not exactly sure how to reproduce which happened when I selected the same file multiple times in a row to be the new alarm. But it doesn't always happen, and once it works once it shouldn't break as it was related to saving the file I think.

Personally, I would still merge this because it is still a very good feature to have, people who use F-droid are probably okay with some small amount of jank in order to get (imo critical) features implemented faster, but if you want to not merge I don't care I wrote this for me. I probably also won't spend too much extra time trying to fix it if you decide this isn't good and won't fix it yourself.

Works by duplicating a file to local app storage, I didn't want to have to do that but it seems android's security model also prevents me from knowing any file paths even with storage permissions when using content API and I don't care to spend too much more time fighting with Android's weird APIs.

Only tested on android 13 so far. I'm not sure what would happen on an older version. I think pre-11 is when they changed some file APIs significantly.

@magnus-ISU
Copy link
Author

Anything you want me to get done before this is merged?

@sweakpl
Copy link
Owner

sweakpl commented Oct 6, 2022

No, it's fine - if it works for you, then that's great.

@sweakpl
Copy link
Owner

sweakpl commented Oct 7, 2022

I've added the feature of selecting custom alarm sounds in d6157cf.

Thanks for help @magnus-ISU.

@sweakpl sweakpl closed this Oct 7, 2022
@BloodRaven0
Copy link

Thanks so much for adding this functionality @magnus-ISU , it works flawlessly! ❤️

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

Successfully merging this pull request may close these issues.

None yet

3 participants