473,625 Members | 3,201 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3693
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...@badco mputer.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
2425
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 and tell me what am I doing wrong. Any help would be appreciated. Thanks Dim Conn As OracleConnection = New OracleConnection("data source=XXXX;user id=XXXXX;password=XXXXX")
1
2358
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 the user to start/stop the audio. The OBJECT tag that I'm using does not cause the audio to be preloaded in MZ. The HTML newsgroup could not suggest a way forward so I'm wondering if there's a way to use javascript to preload the audio -...
0
1307
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 and tell me what am I doing wrong. Any help would be appreciated. Thanks Dim Conn As OracleConnection = New OracleConnection("data source=XXXX;user id=XXXXX;password=XXXXX")
6
7355
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 browser displays or offers to save the binary file instead. I would like to have the browser accept and display the revised HTML code as well as offering to open or save the attached file. This SHOULD be possible using a multipart MIME format -...
7
11775
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) Your first task is to write a program which reads this file into two parallel arrays in memory. One array contains the titles, and the other array contains the authors. The arrays are 'parallel' in the sense that the n-th element of the authors...
2
4553
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 getting on more or less OK. So far, I have managed to parse my tab-delimited .txt file properly into an array, and then use this array to update the tags on a bunch of MP3 audio files. Nice.
7
2102
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 Javascript</title> </HEAD> <body> <script language="Javascript">
4
1510
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 across the socket an write them back ...cud anyone help me. thanks in advance
1
1734
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 stops sometimes on slower computers the audio on the second file gets truncated on the beginning of playing the second file. What can I do to minimize this truncation of audio? Right now I am having to add 1 second of blank audio to the beginning...
0
8253
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8189
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8635
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8354
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8497
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7182
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6116
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5570
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
1802
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.