473,248 Members | 1,230 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,248 software developers and data experts.

Reading (and writing?) audio file tags

I'd like to write some scripts to analyze and manipulate my music
files. The files themselves are in MP3 and FLAC format (mostly MP3,
but FLAC where I ripped original CDs and wanted a lossless format).
I've no idea what form of tags are used in the files (ID3v1, ID3v2,
OGG, APE, ...) I just used whatever the program that set them up used.
I'm completely confused by the various tag formats that exist - there
seems to be little standardisation, and quite a few compatibility
pitfalls. For example, I have files with tags using accented
characters - I suspect that this causes some tools to switch format
(because I've seen what looked like corrupt data at times, which
turned out to be the program displaying the "wrong format" of tag).

I've seen various Python libraries that talk about ID3 tag reading -
but I'm not clear if they read other tag formats (many applications
which call themselves "ID3 readers" actually handle multiple formats,
but I don't know if that's true for (Python) libraries. Also, there
seem to be few libraries that will *write* tags.

Is there a good "music file tag handling" library for Python that's
worth looking at? I use Windows, so it would have to be for that
platform, and although I have a compiler, I don't really want to spend
a lot of time collecting and porting/building support libraries, so
I'd be looking for a binary distribution.

In the absence of something suitable, I'll probably go back to dumping
the tags via a generic "MP3 tag reader" program, then manipulate them
as a text file, then try to do some sort of bulk reload.

Thanks,
Paul.

May 24 '07 #1
3 3672
quoth the Paul Moore:
I'd like to write some scripts to analyze and manipulate my music
files. The files themselves are in MP3 and FLAC format (mostly MP3,
but FLAC where I ripped original CDs and wanted a lossless format).
I've no idea what form of tags are used in the files (ID3v1, ID3v2,
OGG, APE, ...)
Flac files use Vorbis comments, the same that Ogg Vorbis files use. As for
MP3, they use ID3v2 or ID3v1, or both.

Anyway, what you want is Mutagen. It handles both Flac and Mp3 tags, as well
as many others: http://www.sacredchao.net/quodlibet/...opment/Mutagen
I just used whatever the program that set them up used.
I'm completely confused by the various tag formats that exist - there
seems to be little standardisation, and quite a few compatibility
pitfalls. For example, I have files with tags using accented
characters - I suspect that this causes some tools to switch format
(because I've seen what looked like corrupt data at times, which
turned out to be the program displaying the "wrong format" of tag).

I've seen various Python libraries that talk about ID3 tag reading -
but I'm not clear if they read other tag formats (many applications
which call themselves "ID3 readers" actually handle multiple formats,
but I don't know if that's true for (Python) libraries. Also, there
seem to be few libraries that will *write* tags.
ID3 = MP3 only. A lot of people call _all_ tags 'id3' tags to save havingto
say 'Flac tags, and Vorbis tags, and Ape tags' etc....these people are the
source of your confusion.
Is there a good "music file tag handling" library for Python that's
worth looking at? I use Windows, so it would have to be for that
platform, and although I have a compiler, I don't really want to spend
a lot of time collecting and porting/building support libraries, so
I'd be looking for a binary distribution.
From the read me: "Mutagen works on Python 2.3+ and has no dependencies
outside the CPython standard library" so it should work on Windows I think.
It is just pure Python so there you go...
In the absence of something suitable, I'll probably go back to dumping
the tags via a generic "MP3 tag reader" program, then manipulate them
as a text file, then try to do some sort of bulk reload.

Thanks,
Paul.
-d

--
darren kirby :: Part of the problem since 1976 :: http://badcomputer.org
"...the number of UNIX installations has grown to 10, with more expected..."
- Dennis Ritchie and Ken Thompson, June 1972
May 24 '07 #2
On 24 May, 17:22, darren kirby <bulli...@badcomputer.orgwrote:
quoth the Paul Moore:
I'd like to write some scripts to analyze and manipulate my music
files. The files themselves are in MP3 and FLAC format (mostly MP3,
but FLAC where I ripped original CDs and wanted a lossless format).
I've no idea what form of tags are used in the files (ID3v1, ID3v2,
OGG, APE, ...)

Flac files use Vorbis comments, the same that Ogg Vorbis files use. As for
MP3, they use ID3v2 or ID3v1, or both.

Anyway, what you want is Mutagen. It handles both Flac and Mp3 tags, as well
as many others:http://www.sacredchao.net/quodlibet/...opment/Mutagen
Excellent! The web page you mentioned gave "access denied", but I got
to it via Google's cache, and the download link still worked :-)

It does seem to build a Windows installer quite happily, so that's a
great start. I'll see how it goes tonight.

Thanks for the pointer.
Paul.

May 24 '07 #3
Paul Moore napisał(a):
>Anyway, what you want is Mutagen. It handles both Flac and Mp3 tags, as well
as many others:http://www.sacredchao.net/quodlibet/...opment/Mutagen

Excellent! The web page you mentioned gave "access denied", but I got
to it via Google's cache, and the download link still worked :-)
Guys from QuodLibet seem still block access for MSIE users. Anyway, you
may try to get Mutagen source from subversion:

$ svn co http://svn.sacredchao.net/svn/quodlibet/trunk/mutagen

--
Jarek Zgoda

"We read Knuth so you don't have to."
May 25 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Ken | last post by:
Hello, I'm trying to read a Blob from Oracle and then write it to an audio file(.AU). I'm using Visual Studio.Net 2003 (VB). I can't seem to get my code to work. Will someone take a look at it...
1
by: Andrew Poulos | last post by:
I'm dynamically building a standards compliant HTML 4 Strict page depending on how the selections a user makes. If the user chooses audio (a non-streaming format) a custom button appears to allow...
0
by: Ken | last post by:
Hello, I'm trying to read a Blob from Oracle and then write it to an audio file(.AU). I'm using Visual Studio.Net 2003 (VB). I can't seem to get my code to work. Will someone take a look at it...
6
by: john | last post by:
The standard method to transmit a file from an aspx page to a browser is to stream the file to the response then end the response. The HTML code generated by the aspx page is discarded, and the...
7
by: ianenis.tiryaki | last post by:
well i got this assignment which i dont even have a clue what i am supposed to do. it is about reading me data from the file and load them into a parallel array here is the question: Step (1) ...
2
by: Clive Green | last post by:
Hello peeps, I am using PHP 5.2.2 together with MP3_Id (a PEAR module for reading and writing MP3 tags). I have been using PHP on the command line (Mac OS X Unix shell, to be precise), and am...
7
by: Fuji | last post by:
Dear Sir, Why this code can't be ran in my Internet Explorer? Am I doing wrong in using ActiveXObjectScripting.FileSystemObject")? <html> <head><title>Reading/Writing Text File in...
4
by: swts | last post by:
hi, i wud like to know if there is any way in which i cud read audio files an write them back... is it possible to read audio files like text files an wrte them back.i need to send audio fils...
1
by: =?Utf-8?B?Qm9iQWNoZ2lsbA==?= | last post by:
I am using Windows Media Player to play my half second audio files one after the other using the code below... My problem comes when I play a second audio file immediately after the first one...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.