By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,870 Members | 1,189 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,870 IT Pros & Developers. It's quick & easy.

Re[4]: Need help on how to use Pymedia!

P: n/a
From: "CptPicard"
Date: Thu, 05 Aug 2004 17:48:04 GMT
Subject: Re: Re[2]: Need help on how to use Pymedia!
Here is the code which will give you what you need( from pycar ). It is

modified to match what you need and therefore not tested.:

f= open( <file_name>, 'rb' )
dec= acodec.Decoder( <file_extension> )
s= f.read( 20000 )
fr= dec.decode( s )
# Hardcoding for mp3 IDv1 tags
if not dec.hasHeader() and <file_extension>== 'mp3':
f.seek( -128, 2 )
dec= acodec.Decoder( 'mp3' )
dec.decode( f.read( 128 ) )

print dec.getInfo()


I appreciate your support.
I understand that this is a piece of code specially written for fixing my
problem but where could I find such example in pycar ? I looked for Decoder
in the pycar source code (pymedia*-src) and found no match.

Do you include support for tag IDv2 too ?


Yes it is.
The code is located in pycar/audio/aplaylist.py class AudioFileList.getFileParams()
The source for pycar is here: http://prdownloads.sourceforge.net/p...0-pre2-src.zip
Dmitry/
Jul 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a

"Dmitry Borisov" <jb***@mail.ru> wrote in message
news:ma**************************************@pyth on.org...
From: "CptPicard"
Date: Thu, 05 Aug 2004 17:48:04 GMT
Subject: Re: Re[2]: Need help on how to use Pymedia!
Here is the code which will give you what you need( from pycar ). It
is modified to match what you need and therefore not tested.:

f= open( <file_name>, 'rb' )
dec= acodec.Decoder( <file_extension> )
s= f.read( 20000 )
fr= dec.decode( s )
# Hardcoding for mp3 IDv1 tags
if not dec.hasHeader() and <file_extension>== 'mp3':
f.seek( -128, 2 )
dec= acodec.Decoder( 'mp3' )
dec.decode( f.read( 128 ) )

print dec.getInfo()
I appreciate your support.
I understand that this is a piece of code specially written for fixing my problem but where could I find such example in pycar ? I looked for Decoder in the pycar source code (pymedia*-src) and found no match.

Do you include support for tag IDv2 too ?


Yes it is.
The code is located in pycar/audio/aplaylist.py class

AudioFileList.getFileParams()

Indeed!
The source for pycar is here: http://prdownloads.sourceforge.net/p...0-pre2-src.zip Dmitry/

Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.