Bash script to set title of MP3 file equal to name of MP3 file
I bought a tutorial to help me learn a foreign language and want to put the lessons on my ipod. However, none of the hundreds of mp3 files have any tag information. I was able to use eyeD3 to name the artist and album on all the files in batch mode, but none of the files has a title. So when I loaded them into my ipod, no titles are visible. Since the file names are of the form lesson001.mp3, lesson002.mp3, etc, the filenames are ok to use as titles. But how do I do some sort of batch command to place the filename into the 'title' field of the tag? I'm sure there is some simple way to do this using a bash script, but it's been decades since I wrote a bash script. Help!
|
It can more than likely be done via BASH but I am not familair enough with how the meta-data is setup for the file title etc.. I'll do some searching on that and see if I can help. I'm sure someone else here knows more about the way the mp3 files retain that data and may be able to help more directly but I'll see what I can find.
|
This is what I tried, but although it echoed the proper commands, it did not actually perform the commands and no changes were made in the id3 tags of the mp3 files.
for x in `ls`; do echo "eyeD3 --title='$x' file $x"; done |
remove the echo, your not telling the system to execute the eyeD3 command, just to echo it. I was finding similar info and was about to post a similar for loop.
|
Yes, thank you, removing the echo helped, but the script still failed. Eventually I figured out how to use EasyTag to accomplish the task.
|
Hi,
also you should replace youtr `ls` with *. Also the "file" should not be there. Ie Code:
for x in * ; do Eg. Code:
Evo2. |
if your file names have spaces (like my files!) you should change 2nd line to:
Code:
eyeD3 --title="${x%.*}" $x |
Here is a script I use.
Code:
#!/bin/bash |
All times are GMT -5. The time now is 12:57 PM. |