Update of /cvsroot/freevo/freevo/src
In directory sc8-pr-cvs1:/tmp/cvs-serv14983/src
Modified Files:
util.py
Log Message:
A simple function to add tags to MP3s.
Index: util.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/util.py,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** util.py 30 Jun 2003 22:35:04 -0000 1.33
--- util.py 1 Jul 2003 19:44:59 -0000 1.34
***************
*** 10,13 ****
--- 10,16 ----
# -----------------------------------------------------------------------
# $Log$
+ # Revision 1.34 2003/07/01 19:44:59 outlyer
+ # A simple function to add tags to MP3s.
+ #
# Revision 1.33 2003/06/30 22:35:04 outlyer
# Move escape(sql) into escape, and use it now.
***************
*** 569,572 ****
--- 572,595 ----
return s[statvfs.F_BLOCKS] * long(s[statvfs.F_BSIZE])
+
+ def tagmp3 (filename, title=None, artist=None, album=None, track=None,
tracktotal=None, year=None):
+ """
+ use eyeD3 directly from inside mmpython to
+ set the tag. We default to 2.3 since even
+ though 2.4 is the accepted standard now, more
+ players support 2.3
+ """
+ import mmpython.audio.eyeD3 as eyeD3 # Until mmpython has an interface for
this.
+
+ tag = eyeD3.Tag(filename)
+ tag.header.setVersion(eyeD3.ID3_V2_3)
+ if artist: tag.setArtist(artist)
+ if album: tag.setAlbum(album)
+ if title: tag.setTitle(title)
+ if track: tag.setTrackNum((track,tracktotal)) # eyed3 accepts None for
tracktotal
+ if year: tag.setDate(year)
+ tag.update()
+ return
+
#
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog