Tag Archives: mp3

n7player hits v2.0

As I’ve mentioned previously, n7player is one of the coolest music players in the android world. Been a fan of it since its beta stages, I was elated to find out that n7player 2.0 has been released yesterday.

The most noticeable improvement is the better playlist management options. It’s now even _fun_ to move the songs back and forth in the playlist. Now it’s possible to save custom playlists as well. There are improvements in the equalizer and there’s a Genre mode of which I’m not much of a fan. Perhaps it’s time to tag the missing genres in my library. That ain’t easy.

Note that the free version works for only 14 days. They’ve reduced the price of the unlock key now, at $2.

Processing music tags with Python

I was looking for the optimal way to traverse the directory tree with Python and found out that os.walk is the answer. To put this into practice, I wrote the following script which traverses the music library and finds out which MP3s haven’t been properly tagged. In other words, it will print the full paths of all MP3s that have any of the artist, album or title tracks missing. In my case, 502 of the 10466 songs had bad tags.

[sourcecode language=”python”]
#!/usr/bin/python

import os
import id3reader

rootdir = "/home/thameera/Music"
processed = 0
bad = 0

for thisDir, subdirList, fileList in os.walk(rootdir):
for fname in fileList:
if fname[-3:] == 'mp3':
processed += 1
fullPath = os.path.join(thisDir, fname)

try:
id3r = id3reader.Reader(fullPath)
except:
bad += 1
print "Error extracting id3 info from %s" % fullPath
continue

if None in (id3r.getValue('performer'), id3r.getValue('album'), id3r.getValue('title')):
bad += 1
print fullPath

print "%d MP3s processed. Found bad tags in %d of them" % (processed, bad)
[/sourcecode]

It uses the id3reader library to parse the tags. I don’t think it’ll work if you have files with other formats, like wma or flac.

This script can be further expanded to ignore certain directories, output only one entry per each directory that has bad tags, check for other tags as well, check if the artist tag does not match the name of the parent directory, etc, etc.