


    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
              \________/                        