Writing any genres

Eivind Magnus Hvidevold emh at kvarteret.no
Tue Jun 6 16:58:30 CEST 2006


On Tue, Jun 06, 2006 at 12:48:41PM +0200, Rene Maurer wrote:
> 
> Eivind Magnus Hvidevold writes:
> 
> > On Sun, Jun 04, 2006 at 11:32:35PM +0200, Rene Maurer wrote:
> >> 
> >> Is this a problem of the python bindings or anything else (ID3v1/v2)?
> > ID3v1 tags contain an index into a fixed set of genres. 
> > Use ref = MPEGFile(file) and tag = ref.ID3v2Tag(true).
> 
> Thank you very much for answering. My new code looks as follows:
> 
> ,----
> | genre = "blabla"
> | ref = TagLib.MPEGFile(file)
> | tag = track.ID3v2Tag(1)
> | tag.setGenre(genre)
> | track.save()
> `----
You're using track instead of ref.

> Does not work a all. Seams to be a problem with the python bindings?
Works fine here:

[emh at giediprime /tmp]$ cat test.py
#!/usr/bin/env python

import TagLib

ref = TagLib.MPEGFile('a.mp3')
tag = ref.ID3v2Tag(True)
print tag.genre()
tag.setGenre('urfurf')
ref.save()

[emh at giediprime /tmp]$ ./test.py
blabla
[emh at giediprime /tmp]$ ./test.py
urfurf
[emh at giediprime /tmp]$

> PS
> Why haven't you answered to the devel list?
Our mail server times out on SMTP against ktown.kde.org. We're having
problems with timeouts against some other servers too. I'm not sure
what's causing it and haven't gotten around to debug it yet.

-- 
EMH
Computer science for finite automata, microbiology for infinite tomato.


More information about the taglib-devel mailing list