Copy Link
Add to Bookmark
Report

NULL mag Issue 08 25 Import mp3 files with tags

eZine's profile picture
Published in 
null magazine
 · 26 Dec 2020

  




while i was reading some text messages in fsx, someone was asking
about a script to add ID3 tags/data to various MP3 files he had. i am
not sure how he was imagining to implement this, but below is a simple
way to do so.

i used BASH for simplicity and flexibility. after search some
utilities to get the ID3 tags, i finally chose MP3INFO, mainly because
it has a nice way to format the output format. very simple and slick.
so to use the script below, make sure to install mp3info.

sudo apt-get install mp3info

you could also use ffprobe, which comes with ffmpeg, so you probably
have it all ready in your computer, eyeD3 or any other utility.

the script examines a mp3 file for ID3 tags and writes them to a temp.
file_id.diz file. then it takes the original mp3 file and the
file_id.diz and creates a new archive (zip) with both of them, simply
just stored. no compression, there is no need.

this way, you can take the .zip files and upload them to any BBS. the
BBS server, will check for the .diz file and add it as a description
in the file area. simply enough... :)

--8<-------8<-------8<-------8<-------8<-------8<-------8<-------8<-----

#!/bin/bash

spacer="--------------------------------------"

for file in "$@"; do
echo $file
echo "$spacer" > file_id.diz
mp3info "$file" -p "\x0E %t\n" >> file_id.diz
echo "$spacer" >> file_id.diz

mp3info "$file" -p "Size : %k KB\t\Durat.: %mm %ssec\nLayer : \
%L\tStereo: \%o\nArtist: %a\nAlbum : %l\nGenre : %g\tYear: %y\n"\
>> file_id.diz

echo "$spacer" >> file_id.diz
zip -0 "$file".zip "$file" file_id.diz
rm -f file_id.diz
done

--->8-------->8-------->8-------->8-------->8-------->8-------->8--------




<<< null e-magazine x008 (text edition) >>>
____ _____ _____ _____ http://github.com/xqtr/null
___/. \/ /_________/. /__/. /__jp!_ andr01d.zapto.org:9999
//_ \ . / / \ / _// agency.bbs.nz
/____/\____/ / /__________________\ d1st.org
\________/

← previous
next →
loading
sending ...
New to Neperos ? Sign Up for free
download Neperos App from Google Play
install Neperos as PWA

Let's discover also

Recent Articles

Recent Comments

Neperos cookies
This website uses cookies to store your preferences and improve the service. Cookies authorization will allow me and / or my partners to process personal data such as browsing behaviour.

By pressing OK you agree to the Terms of Service and acknowledge the Privacy Policy

By pressing REJECT you will be able to continue to use Neperos (like read articles or write comments) but some important cookies will not be set. This may affect certain features and functions of the platform.
OK
REJECT