Quick Guide: Maintain Playlist Order on Mini Audio Players
1. Issues
The player may not follow the order of your audio file names all the time, but it will follow the order in which your audio files are written to the SD Card.
2. Solution
Remember, the key is the order in which files are written to the microSD card or USB.
To maintain the playlist order on mini audio players, follow these simple steps:
1. Format your microSD card using FAT32.
2. (This step is optional) Create a folder named "AAAA" on the microSD card.
3. Backup your original audio files and use a bulk rename tool to prepend a 4-digit number (starting with 1111) to the file names.
4. Sort the renamed files by name in ascending order.
5. For Windows OS, Click the first file to select it, <= this step is important, then press Ctrl + A, Ctrl + C, and Ctrl + V to copy and paste the files into the "AAAA" folder on the microSD card.
Tip: on Linux OS, you may try using a twin panel file management like Krusader file manager to copy them conveniently.
Or if you want to use CLI:
AAAA is the source dir, create AAAA dir on your microSD, then run this command
find AAAA -type f -print0 | sort -z | xargs -0 -I {} cp -rv {} /path/to/your/sdcard/AAAA/
6. Insert the microSD card into your mini player and press the corresponding number to play a specific file.
Good luck!
3. Bonus tips
3.1 Check for corrupted files
If you have renamed your files properly and copied them in order, but they are still not working as expected, there may be corrupted audio files in your collection. Be sure to check for this.
To prevent issues, it is recommended to delete (replace) any non-English characters and use only ASCII characters in the filenames. Additionally, replace any whitespaces with - or _.
3.2 Renaming Files
To rename your files, use a bulk rename software if you have many files to rename. For less than 10 files, you can rename them manually. Numerous free applications are available for this; please search for them online.
For example, if you have audio files sorted by name in ascending order like this:
file_01.mp3
file_02.mp3
file_03.mp3
file_04.mp3
After prepending the above pattern, you should have:
1111_file_01.mp3
1112_file_02.mp3
1113_file_03.mp3
1114_file_04.mp3
Once you have renamed your audio files, copy them in order to the designated directory on your microSD card that you created in the previous step. Then insert the microSD card into your mini player and check! To play the first file, 1111_file_01.mp3, press 1. To play the nth file, press the corresponding number.
For generating a playlist, please see the tips below.
3.3 Adding More Files
If you have another collection of audio files, create another directory named BBBB on your microSD card. Rename the new files, starting with the last number used in the AAAA directory plus one. For example, if the last used number in AAAA is 8880, the starting number in BBBB will be 8881.
3.4 Generating a Playlist to Print Out
To generate a playlist of your audio files, you can use the following commands in your device's Terminal. First, navigate to the directory of your collected audio files.
# While inside your audio directory
ls -a > all.txt
cat -n all.txt > all_with_number.txt
To list the files, alternatively you can also use the "find" command, like:
find . -type f -name "*.mp3" > all.txt
The first command will list all of your audio files to a text file named all.txt. The second command will prepend a line number before each line and save the result to all_with_number.txt. These numbers correspond to the number you need to press on the player to play a particular file.
Using the example above, we will get:
1 1111_file_01.mp3
2 1112_file_02.mp3
3 1113_file_03.mp3
4 1114_file_04.mp3
You can also automate all of these steps with a Python script. To transliterate non-English characters to ASCII characters, you can use the unidecode module (install with pip3 install -U unidecode).
These steps can be performed on an Android device. Use
TotalCommander file manager, which has a built-in multi-rename tool, and
Termux app F-droid to run Python3 and Terminal emulator.
Comments
Post a Comment