On Thu, 2009-01-29 at 22:28 +0100, Hans Meine wrote:
> > Ubuntu doesn't seem to package the bindings.) But since our decision to
> > use Python 2.5, we could use ctypes to talk to taglib directly.
>
> Don't know if that wouldn't be too much work (which would better be spent
> elsewhere).
It depends. Yes, interfacing with a library through ctypes is
cumbersome, but it could well be less time overall than debugging bugs
related to EXIF.py or eyeD3's lack of robustness.
It's going to depend on the complexity of the API of the library (taglib
or libexif, say).
taglib has a simple (and limited, but might be good enough for us) C API
too. The following trivial snippet extracts audio metadata:
import sys
from ctypes import *
tl = CDLL('libtag_c.so.0')
file = tl.taglib_file_new(sys.argv[1])
props = tl.taglib_file_audioproperties(file)
print 'Length:', c_uint(tl.taglib_audioproperties_length(props)).value
print 'Bitrate:', c_uint(tl.taglib_audioproperties_bitrate(props)).value
print 'Samplerate:',
c_uint(tl.taglib_audioproperties_samplerate(props)).value
print 'Channels:',
c_uint(tl.taglib_audioproperties_channels(props)).value
tag = tl.taglib_file_tag(file)
print 'Title:', c_char_p(tl.taglib_tag_title(tag)).value
print 'Artist:', c_char_p(tl.taglib_tag_artist(tag)).value
print 'Album:', c_char_p(tl.taglib_tag_album(tag)).value
print 'Comment:', c_char_p(tl.taglib_tag_comment(tag)).value
print 'Genre:', c_char_p(tl.taglib_tag_genre(tag)).value
print 'Year:', c_uint(tl.taglib_tag_year(tag)).value
print 'Track:', c_uint(tl.taglib_tag_year(tag)).value
And it works:
t...@viper:~$ python tl.py
/data/mp3/George_Carlin/You_Are_All_Diseased/01_Hows_Everybody_Doin.mp3
Length: 54
Bitrate: 192
Samplerate: 44100
Channels: 2
Title: How's Everybody Doin'
Artist: George Carlin
Album: You Are All Diseased
Comment: Created by Grip
Genre: Comedy
Year: 0
Track: 0
I haven't done any investigation to see if it provides all the features we use
from eyeD3 however.
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Freevo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-devel