Making Android Ringtones
I’m adding ringtones via Termux because you can script the process! Instructions assume a ~ (Termux home) start point.
Download the file from wherever you’re keeping it. You can use curl or some other such thing. There are some Creative Commons files you can get off YouTube with youtube-dl (although YouTube frowns on downloading their videos at all).
youtube-dl --extract-audio --audio-format mp3 <link to YT video>
You then need to move this to the Ringtones folder (or Notifications or Alarms depending on your usecase).
mv <name of file> storage/shared/Ringtones/
You then need to force the Android Media Scanner to recognize the file. You can do that with the following command:
termux-media-scan -v /storage/emulated/0/Ringtones/<name of file>
If you haven’t yet, you will need to install the Termux:API app from the app store and run the following command to get the termux-media-scan command.
apt install termux-api
Remember that tab completion is your friend! Termux has a special keys bar that you can turn on in its settings if your keyboard doesn’t have a tab key!